Smalltalk.st
author Claus Gittinger <cg@exept.de>
Fri, 06 Oct 2006 11:49:43 +0200
changeset 10041 1ef0cb09523b
parent 9937 fc6bfabec990
child 10046 1b39e1efbf0e
permissions -rw-r--r--
protocol for startability via browser slightly changed
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
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
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
9927
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    15
	instanceVariableNames:''
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    16
	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    17
		NumberOfClassesHint SystemPath StartupClass StartupSelector
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    18
		StartupArguments CommandLine CommandName CommandLineArguments
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    19
		CachedAbbreviations SilentLoading Initializing StandAlone
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    20
		HeadlessOperation IsPlugin IsSharedLibraryComponent
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    21
		DebuggingStandAlone LogDoits LoadBinaries RealSystemPath
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    22
		ResourcePath SourcePath BitmapPath BinaryPath FileInPath
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    23
		PackagePath BinaryDirName ResourceDirName SourceDirName
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    24
		BitmapDirName PackageDirName FileInDirName ChangeFileName
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    25
		ImageStartTime ImageRestartTime DemoMode SaveEmergencyImage
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    26
		SpecialObjectArray CallbackSignal KnownPackages
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    27
		ClassesFailedToInitialize HasNoConsole'
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    28
	poolDictionaries:''
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
    29
	category:'System-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    30
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    32
Smalltalk comment:'declared from: ..\..\..\stx\libbasic\abbrev.stc'
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    33
!
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    34
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
    35
!Smalltalk class methodsFor:'documentation'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    36
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    37
copyright
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    38
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    39
 COPYRIGHT (c) 1988 by Claus Gittinger
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    40
              All Rights Reserved
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    41
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    42
 This software is furnished under a license and may be used
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    43
 only in accordance with the terms of that license and with the
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    44
 inclusion of the above copyright notice.   This software may not
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    45
 be provided or otherwise made available to, or used by, any
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    46
 other person.  No title to or ownership of the software is
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    47
 hereby transferred.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    48
"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    49
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    50
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    51
documentation
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    52
"
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    53
    This is one of the central classes in the system;
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    54
    it provides all system-startup, shutdown and maintenance support.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    55
    Also global variables are (conceptionally) kept here.
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    56
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    57
    As you will notice, this is NOT a Dictionary
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    58
    - my implementation of globals is totally different
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    59
      due to the need to be able to access globals from c-code as well,
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    60
      I do not use associations for globals, but instead keep the
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    61
      name<->value relations in the VM and access globals via utility
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    62
      functions found there.
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    63
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    64
    However, it provides the known enumeration protocol.
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    65
    It may change to become a subclass of collection at some time,
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    66
    to inherit more collection stuff ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    67
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    68
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    69
    [Instance variables:]
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    70
                                        none - all handling is done in the VM
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    71
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    72
    [Class variables:]
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    73
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    74
        StartBlocks     <Collection>    blocks to be executed in a separate process after
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    75
                                        everything has been initialized. These blocks will
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    76
                                        be deleted after execution and therefore not be
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    77
                                        executed after an image restart. Initial processes
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    78
                                        (such as the Launcher) are usually started here.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    79
                                        These blocks are added by smalltalk.rc/private.rc etc.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    80
                                        via #addStartBlock during early initialization.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    81
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    82
        ImageStartBlocks 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    83
                        <Collection>    blocks to be executed in a separate process after
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    84
                                        everything has been initialized. These blocks will be
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    85
                                        executed after an image restart.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    86
                                        These blocks are usually added by smalltalk_r.rc etc.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    87
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    88
        ExitBlocks      <Collection>    blocks to evaluate before system is
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    89
                                        left. Not currently used (GNU-ST compatibility).
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    90
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    91
        SystemPath      <Collection>    path to search for system files (sources, bitmaps etc)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    92
                                        Set to a default here, but typically changed from some
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    93
                                        startup.rc file
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    94
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    95
        PackagePath     <Collection>    path to search for package.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    96
                                        This is going to replace the above systemPath, and a classes
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    97
                                        resources will eventually searched in its package directory.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    98
                                        This list defines the path, where packages are searched for,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
    99
                                        initially this is something like /opt/smalltalk/packages.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   100
                                        Set to a default here, but typically changed from some
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   101
                                        startup.rc file
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   102
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   103
        StartupClass    <Class>         class and selector, where the system starts up
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   104
        StartupSelector <Symbol>        (right after VM initialization)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   105
        StartupArguments <Array>        If an image is saved while those being nonNil, 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   106
                                        the image will come up there.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   107
                                        Allows for customized images to be generated from a standard ST/X.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   108
                                        StandAlone programs also set those during initialization.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   109
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   110
        CommandLine          <String>   Unix (OS-) command line
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   111
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   112
        CommandName          <String>   the command (i.e. argv[0])
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   113
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   114
        CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   115
                                        CommandName has been stripped off.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   116
                                        (initially set by the VM)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   117
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   118
        SilentLoading   <Boolean>       suppresses messages during fileIn and in compiler
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   119
                                        (can be set to true from a customized main.c)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   120
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   121
        Initializing    <Boolean>       true while (re-)initializing
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   122
                                        Controls the behavior of certain error
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   123
                                        reporters (for example: suppress dialogBoxes)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   124
                                        while the system is not yet fit for full operation.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   125
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   126
        StandAlone      <Boolean>       true, if this is a standalone app;
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   127
                                        if true the process scheduler watches for
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   128
                                        which processes are still running, and 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   129
                                        exits ST/X, when the last non-background
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   130
                                        and non-system process exits.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   131
                                        Can be set in an application-specific startup script,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   132
                                        or, for standAlone programs, by C-code during initialization.
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   133
                                        
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   134
        HeadlessOperation               if true, a non-existing Display connection
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   135
                        <Boolean>       will NOT lead to an error-exit during startup.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   136
                                        Default is false.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   137
                                        Can be set in an application-specific startup script,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   138
                                        or, for standAlone programs, by C-code during initialization.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   139
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   140
        LogDoits        <Boolean>       if true, doits are also logged in the changes
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   141
                                        file. Default is false, since the changes file
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   142
                                        may become huge if every tiny doIt is saved there ...
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   143
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   144
        LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   145
                                        file, if present. If false, this is always suppressed.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   146
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   147
        SaveEmergencyImage <Boolean>    if true (the default), an emergency image
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   148
                                        is saved, if the main Display looses its
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   149
                                        connection. This is useful if you have a
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   150
                                        flaky display connection (serial line)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   151
                                        and want to have your stuff saved automatically
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   152
                                        in case of a broken connection.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
   153
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   154
    strictly private classVariables (helpers):
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   155
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   156
        CachedClasses   <Collection>    known classes (cached for faster class enumeration)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   157
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   158
        CachedAbbreviations
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   159
                        <Dictionary>    className to filename mappings
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   160
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   161
        RealSystemPath  <Collection>    cached collection of directories along the path
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   162
                                        which really exist. Caching avoids long checks
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   163
                                        for existing directories on broken NFS volumes.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   164
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   165
        SourcePath      <Collection>    cached names of really existing directories
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   166
        BitmapPath                      These are remembered, since in NFS systems,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   167
        ResourcePath                    the time to lookup files may become long
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   168
        BinaryPath                      (especially, if some directories are on machines
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   169
        FileInPath                      which are not up ...). 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   170
                                        Therefore, the set of really
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   171
                                        existing directories is cached when the SystemPath
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   172
                                        is walked the first time.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   173
                                        A consequence is that you have to invoke
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   174
                                        flushSystemPath, when you create any of those
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   175
                                        directories while running
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   176
                                        (and want the running ST/X to look there)
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   177
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   178
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   179
    [author:]
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   180
        Claus Gittinger
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   181
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   182
    [see also:]
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   183
        ObjectMemory
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
   184
"
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   185
!
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   186
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   187
readme_resources
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   188
"
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   189
    What is a resource file:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   190
        resource files contain language transformation and sometimes    
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   191
        UI-look specifics such as icons etc.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   192
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   193
    Where are resources stored in the image:
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   194
        Resource files are only read on demand (i.e. when needed) and only read once 
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   195
        i.e. they are cached in the image).
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   196
        The cached data is held in a per-class class-instVar named 'ClassResources'.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   197
        With only a few exceptions, the only classes which need resources are the GUI
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   198
        classes under the SimpleView hierarchy.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   199
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   200
    How does the system find resources:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   201
        The idea is that the system-provided resource files can be overwritten
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   202
        by the user or an application configuration.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   203
        This works via a hierarchy of directories where resources are searched for,
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   204
        with the systems standard resource-files being at the end of that chain.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   205
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   206
        When searching for a resource file for class X, the following files are searched 
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   207
        in order:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   208
                {ResourcePath} / resources / X.rs       
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   209
                {SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs       
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   210
                {ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs       
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   211
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   212
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   213
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   214
!Smalltalk class methodsFor:'initialization'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   215
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   216
initGlobalsFromEnvironment
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   217
    "setup globals from the shell-environment"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   218
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   219
    |envString i langString terrString|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   220
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   221
    StandAlone isNil ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   222
        StandAlone := false.
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   223
    ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   224
    HeadlessOperation isNil ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   225
        HeadlessOperation := false.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   226
    ].
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   227
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   228
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   229
     extract Language and LanguageTerritory from LANG variable.
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   230
     valid are for example:
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   231
                            en_en / en
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   232
                            en_us
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   233
                            en_gb
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   234
                            de_de / de
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   235
                            de_at       (for Austria)
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   236
    "
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   237
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   238
    Language := #en.
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   239
    LanguageTerritory := #us.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   240
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   241
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   242
    "Format of LANG is: language[_territory][.codeset][@modifier]
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   243
        language        ISO-639  Language code
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   244
        territory       ISO-3166 Contry code"
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   245
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   246
    envString := OperatingSystem getLanguage.
3991
7b53bc45bf91 (isNil or:[isEmpty ]) -> (size == 0)
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   247
    envString size > 0 ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   248
        i := envString indexOf:$@.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   249
        (i ~~ 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   250
            envString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   251
            LanguageModifier := (envString copyFrom:(i + 1)) asLowercase asSymbol.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   252
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   253
            LanguageModifier := nil.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   254
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   255
        i := envString indexOf:$..
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   256
        (i ~~ 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   257
            envString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   258
            LanguageCodeset := (envString copyFrom:(i + 1)) asLowercase asSymbol
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   259
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   260
            LanguageCodeset := #'iso8859-1'.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   261
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   262
        i := envString indexOf:$_.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   263
        (i == 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   264
            langString := envString.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   265
            terrString := envString
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   266
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   267
            langString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   268
            terrString := envString copyFrom:(i + 1)
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   269
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   270
        Language := langString asLowercase asSymbol.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   271
        LanguageTerritory := terrString asLowercase asSymbol
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   272
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   273
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   274
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   275
     Smalltalk initGlobalsFromEnvironment
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   276
    "
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   277
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   278
    "Modified: 22.2.1996 / 16:59:12 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   279
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   280
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   281
initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   282
    "initialize interrupts"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   283
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   284
    OperatingSystem enableUserInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   285
    OperatingSystem enableHardSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   286
    OperatingSystem enableCrashSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   287
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   288
    ObjectMemory userInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   289
    ObjectMemory signalInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   290
    ObjectMemory recursionInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   291
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   292
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   293
     Smalltalk initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   294
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   295
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   296
    "Modified: 20.8.1997 / 09:35:49 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   297
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   298
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   299
initStandardStreams
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   300
    "initialize some well-known streams"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   301
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   302
    Stdout := NonPositionableExternalStream forStdout.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   303
    Stderr := NonPositionableExternalStream forStderr.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   304
    Stdin := NonPositionableExternalStream forStdin.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   305
    Printer := PrinterStream.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   306
    Transcript := Stderr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   307
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   308
    "
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   309
     Smalltalk initStandardStreams
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   310
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   311
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   312
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   313
initStandardTools
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   314
    "predefine some tools which we will need later
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   315
     - if the view-classes exist,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   316
       they will redefine Inspector and Debugger for graphical interfaces"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   317
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   318
    "redefine debug-tools, if view-classes exist"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   319
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   320
    Display notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   321
        InspectorView notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   322
            Inspector := InspectorView
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   323
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   324
        DebugView notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   325
            Debugger := DebugView
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   326
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   327
        Display initialize
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   328
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   329
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   330
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   331
     Smalltalk initStandardTools
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   332
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   333
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   334
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   335
initSystemPath
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   336
    "setup path where system files are searched for.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   337
     the default path is set to:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   338
            .
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   339
            <directory of exe>       (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   340
            $HOME                    (if defined)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   341
            $HOME/.smalltalk         (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   342
            $SMALLTALK_LIBDIR        (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   343
            $STX_LIBDIR              (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   344
            $STX_TOPDIR              (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   345
            REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   346
            REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir')                  (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   347
            <standard places>
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   348
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   349
     standard places (unix):
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   350
            /opt/smalltalk/<release> (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   351
            /opt/smalltalk           (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   352
            /usr/local/lib/smalltalk (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   353
            /usr/lib/smalltalk       (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   354
            /lib/smalltalk           (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   355
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   356
     win32:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   357
            \programs\exept\smalltalk (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   358
            \programs\smalltalk       (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   359
            \smalltalk                (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   360
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   361
     vms:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   362
            $stx:lib                 (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   363
            $stx:root                (if existing)
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   364
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   365
     of course, it is possible to add entries from the 'smalltalk.rc'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   366
     startup file; add expressions such as:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   367
            Smalltalk systemPath addFirst:'/foo/bar/baz'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   368
        or: 
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   369
            Smalltalk systemPath addLast:'/fee/foe/foo'.
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   370
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   371
     However, smalltalk.rc itself must be found along the above path.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   372
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   373
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   374
    ChangeFileName := 'changes'.
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   375
    OperatingSystem isVMSlike ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   376
        BitmapDirName := 'bitmaps.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   377
        BinaryDirName := 'binary.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   378
        SourceDirName := 'source.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   379
        ResourceDirName := 'resources.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   380
        FileInDirName := 'filein.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   381
        PackageDirName := 'packages.dir'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   382
    ] ifFalse:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   383
        BitmapDirName := 'bitmaps'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   384
        BinaryDirName := 'binary'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   385
        SourceDirName := 'source'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   386
        ResourceDirName := 'resources'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   387
        FileInDirName := 'fileIn'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   388
        PackageDirName := 'packages'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   389
    ].
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   390
680
6f5794a26d2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   391
    SystemPath isNil ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   392
        SystemPath := OperatingSystem defaultSystemPath.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   393
        self flushPathCaches
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   394
    ].
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   395
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   396
    PackagePath isNil ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   397
        PackagePath := OperatingSystem defaultPackagePath.
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   398
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   399
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   400
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   401
     Smalltalk initSystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   402
     Smalltalk systemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   403
    "
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   404
5145
23bca61caa40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5144
diff changeset
   405
    "Modified: / 24.12.1999 / 00:23:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   406
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   407
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   408
initUserPreferences
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   409
    "setup other stuff"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   410
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   411
    LogDoits := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   412
    LoadBinaries := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   413
    SaveEmergencyImage := (StandAlone ~~ true).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   414
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   415
    "Modified: / 24.10.1997 / 18:22:47 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   416
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   417
7526
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   418
initializeClass:aClass
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   419
    "sent from VM via #initializeModules"
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   420
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   421
    Error handle:[:ex |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   422
        ClassesFailedToInitialize isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   423
            ClassesFailedToInitialize := IdentitySet new.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   424
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   425
        ClassesFailedToInitialize add:aClass.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   426
        ('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   427
        (Smalltalk commandLineArguments includes:'--debug') ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   428
            ex reject
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   429
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   430
    ] do:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   431
        aClass initialize
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   432
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   433
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   434
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   435
initializeModules
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   436
    "perform module specific initialization and
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   437
     send #initialize to all classes.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   438
     Notice: this is not called when an image is restarted"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   439
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   440
    self initializeModulesOnce.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   441
    ClassesFailedToInitialize size > 0 ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   442
        ('Smalltalk [info]: retry initialization of failed class(es)...') infoPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   443
        ClassesFailedToInitialize := nil.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   444
        self initializeModulesOnce.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   445
        ClassesFailedToInitialize size > 0 ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   446
            ('Smalltalk [error]: class(es) persist to fail during initialize') errorPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   447
        ]
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   448
    ].
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   449
!
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   450
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   451
initializeModulesOnce
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   452
    "perform module specific initialization and
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   453
     send #initialize to all classes.
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   454
     Notice: this is not called when an image is restarted"
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   455
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   456
%{
1688
8a42db1eea60 removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents: 1682
diff changeset
   457
    __init_registered_modules__(3);
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   458
1481
90a28fd060bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   459
    @global(DemoMode) = __getDemoMode() ? true : false;
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   460
    RETURN (self);
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   461
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   462
    ^ self primitiveFailed
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   463
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   464
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   465
initializeSystem
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   466
    "initialize all other classes; setup dispatcher processes etc.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   467
     This one is the very first entry into the smalltalk world,
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   468
     right after startup, ususally immediately followed by Smalltalk>>start.
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   469
     Notice: 
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   470
        this is not called when an image is restarted; in this
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   471
        case the show starts in Smalltalk>>restart."
211
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   472
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   473
    |idx|
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   474
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
   475
    NumberOfClassesHint := 4500.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
   476
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   477
    Initializing := true.
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   478
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   479
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   480
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   481
    CommandLineArguments isNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   482
        CommandLineArguments := #('stx').
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   483
    ].
4006
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   484
    CommandLine := CommandLineArguments copy.
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   485
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
   486
    CommandName := CommandLineArguments removeFirst. "/ the command
4006
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   487
4028
b46539f16af5 added --silentStartup argument
Claus Gittinger <cg@exept.de>
parents: 4026
diff changeset
   488
    SilentLoading := (CommandLineArguments includes:'--silentStartup').
348
claus
parents: 345
diff changeset
   489
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   490
    DebuggingStandAlone := false.
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   491
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   492
    StandAlone ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   493
        InfoPrinting := false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   494
        ObjectMemory infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   495
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   496
        idx := CommandLineArguments indexOf:'--debug'.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   497
        idx ~~ 0 ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   498
            DebuggingStandAlone := true.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   499
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   500
        DebuggingStandAlone ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   501
            Inspector := MiniInspector.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   502
            Debugger := MiniDebugger.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   503
        ].
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   504
    ] ifFalse:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   505
        "/
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   506
        "/ define low-level debugging tools - graphical classes are not prepared yet
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   507
        "/ to handle things. 
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   508
        "/ This will bring us into the MiniDebugger when an error occurs during startup.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   509
        "/
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   510
        Inspector := MiniInspector.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   511
        Debugger := MiniDebugger.
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   512
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   513
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   514
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   515
    "/ start catching SIGSEGV and SIGBUS
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   516
    "/
713
32540afb8ffc setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   517
    OperatingSystem enableHardSignalInterrupts.
32540afb8ffc setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   518
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   519
    self initGlobalsFromEnvironment.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   520
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   521
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   522
    "/ sorry - there are some, which MUST be initialized before ..
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   523
    "/ reason: if any error happens during init, we need Signals, Stdout etc. to be there
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   524
    "/
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   525
    Object initialize.
7704
a193fbc5eb52 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7696
diff changeset
   526
    Stream initialize.
a193fbc5eb52 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7696
diff changeset
   527
    PositionableStream initialize.
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   528
    Filename initialize.
326
d2902942491d *** empty log message ***
claus
parents: 325
diff changeset
   529
    ObjectMemory initialize.
2504
ece15ffbcb69 Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents: 2485
diff changeset
   530
    OperatingSystem initialize.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   531
    ExternalStream initialize.
211
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   532
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   533
    self initStandardStreams.    "/ setup Stdin, Stdout etc.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   534
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   535
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   536
    "/ sorry, path must be set before ...
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   537
    "/ reason: some classes need it during initialize (they might need resources, bitmaps etc)
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   538
    "/
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   539
    self initSystemPath.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   540
a27a279701f8 Initial revision
claus
parents:
diff changeset
   541
    Compiler := ByteCodeCompiler.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   542
    Compiler isNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   543
        "
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   544
         ByteCodeCompiler is not in the system (i.e. has not been linked in)
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   545
         this allows at least immediate evaluations for runtime systems without compiler
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   546
         NOTICE: a parser is always needed, otherwise we cannot read resource files etc.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   547
        "
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   548
        Compiler := Parser
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   549
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
   550
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   551
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   552
    "/ another one, to be initialized before others
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   553
    "/
2077
6b5dc412dd15 must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   554
    ProcessorScheduler initialize.
6b5dc412dd15 must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   555
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   556
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   557
    "/ now, finally, initialize all other classes
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   558
    "/
325
claus
parents: 324
diff changeset
   559
    self initializeModules.
claus
parents: 324
diff changeset
   560
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   561
    ImageStartTime := Timestamp now.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   562
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
   563
    self initInterrupts.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   564
    self initUserPreferences.
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   565
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   566
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   567
    "/ give classes a chance to perform 2nd-level initialization
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   568
    "/ now, we are certain, that all other classes have been initialized
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   569
    "/ (especially: streams and signals can now be used)
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   570
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   571
    ObjectMemory changed:#initialized.
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   572
2504
ece15ffbcb69 Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents: 2485
diff changeset
   573
    "Modified: 8.1.1997 / 19:58:12 / stefan"
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   574
    "Modified: 7.9.1997 / 23:34:44 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   575
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   576
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   577
isInitialized
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   578
    "this returns true, if the system is properly initialized;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   579
     i.e. false during startup. Especially, the whole viewing stuff is
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   580
     not working correctly until initialized."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   581
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   582
    ^ Initializing not
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   583
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   584
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   585
reinitStandardStreams
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   586
    "reinitialize some well-known streams.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   587
     Tis must be done very early during startup, to allow for
477
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   588
     debug and trace messages to be output
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   589
     (otherwise, the file-descriptors are invalid)"
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   590
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   591
    Stdout reOpen. Stderr reOpen. Stdin reOpen.
161
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   592
! !
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   593
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   594
!Smalltalk class methodsFor:'Compatibility-Squeak'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   595
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   596
beep
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   597
    Screen current beep
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   598
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   599
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   600
garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   601
   ObjectMemory garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   602
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   603
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   604
garbageCollectMost
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   605
    "collect recently created garbage; return the amount of freeSpace.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   606
     In ST/X, only the newSpace is collected here, and the sum of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   607
     newSpace + freeListSpace is returned."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   608
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   609
    ObjectMemory scavenge.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   610
    ^ ObjectMemory freeSpace 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   611
      + (ObjectMemory newSpaceSize - ObjectMemory newSpaceUsed)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   612
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   613
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   614
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   615
isMorphic
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   616
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   617
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   618
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   619
registerExternalObject: anObject
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   620
    "Register the given object in the external objects array and return its index.
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   621
     If it is already there, just return its index.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   622
     ExternalObjects are protected from GC and can be accessed easily from
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   623
     primitive code (via the global Smalltalk:SpecialObjectArray)"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   624
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   625
    | objects firstEmptyIndex obj sz newObjects |
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   626
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   627
    objects := SpecialObjectArray.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   628
    objects isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   629
        objects := Array new:5.
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   630
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   631
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   632
    "find the first empty slot and look if already registered"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   633
    firstEmptyIndex := 0.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   634
    1 to: objects size do: [:i |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   635
        obj := objects at: i.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   636
        obj == anObject ifTrue: [^ i].  "object already there, just return its index"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   637
        (obj == nil and: [firstEmptyIndex = 0]) ifTrue: [
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   638
            firstEmptyIndex := i
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   639
        ]
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   640
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   641
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   642
    "if no empty slots, expand the array"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   643
    firstEmptyIndex = 0 ifTrue: [
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   644
        sz := objects size.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   645
        newObjects := objects species new: sz + 20.  "grow linearly"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   646
        newObjects replaceFrom: 1 to: sz with: objects startingAt: 1.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   647
        firstEmptyIndex := sz + 1.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   648
        SpecialObjectArray := newObjects.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   649
        objects := newObjects
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   650
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   651
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   652
    objects at: firstEmptyIndex put: anObject.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   653
    ^ firstEmptyIndex
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   654
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   655
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   656
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   657
renameClassNamed:oldName as:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   658
    self renameClass:(self at:oldName) to:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   659
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   660
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   661
unregisterExternalObject: anObject
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   662
    "Unregister the given object in the external objects array. 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   663
     Do nothing if it isn't registered."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   664
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   665
    |objects|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   666
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   667
    anObject isNil ifTrue:[^ self].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   668
    objects := SpecialObjectArray.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   669
    1 to: objects size do: [:i |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   670
        (objects at: i) == anObject ifTrue: [
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   671
            objects at: i put: nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   672
        ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   673
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   674
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   675
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   676
!Smalltalk class methodsFor:'Compatibility-V''Age'!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   677
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   678
allClassesImplementing:aSelector
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
   679
    ^ self allClassesForWhich:[:cls | cls implements:aSelector].
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
   680
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
   681
    "Modified: / 10-08-2006 / 12:12:17 / cg"
9090
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   682
!
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   683
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   684
declareConstant:constantName poolName:poolName value:value
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   685
    |pool|
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   686
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   687
    pool := self classNamed:poolName.
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   688
    pool declareConstant:constantName value:value
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   689
!
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   690
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   691
declarePoolDictionary:poolDictionaryName
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   692
    SharedPool subclass:(poolDictionaryName asSymbol)
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   693
        instanceVariableNames:''
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   694
        classVariableNames:''
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   695
        poolDictionaries:''
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   696
        category:nil
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   697
! !
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   698
7295
9ddb9543e369 category
Claus Gittinger <cg@exept.de>
parents: 7290
diff changeset
   699
!Smalltalk class methodsFor:'Compatibility-VW5.4'!
6094
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   700
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   701
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
   702
    |newClass|
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   703
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   704
    indexed == #none ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   705
        newClass := superclass 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   706
            subclass:nameSymbol 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   707
            instanceVariableNames:instVars
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   708
            classVariableNames:'' 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   709
            poolDictionaries:'' 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   710
            category:category 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   711
            inEnvironment:self.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   712
        classInstVars size > 0 ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   713
            newClass class instanceVariableNames:classInstVars.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   714
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   715
        ^ newClass
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   716
    ].
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   717
    self shouldImplement.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   718
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   719
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   720
!Smalltalk class methodsFor:'accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   721
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   722
associationAt:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   723
    "return a key-value association for aKey.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   724
     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
   725
     simulated here."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   726
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   727
    |val|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   728
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   729
    val := self at:aKey ifAbsent:nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   730
    val isNil ifTrue:[^ nil].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   731
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   732
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   733
    "Created: / 1.11.1997 / 13:27:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   734
!
3083
451912c492ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3062
diff changeset
   735
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   736
associationAt:aKey ifAbsent:exceptionBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   737
    "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
   738
     from exceptionBlock, if no such key is present.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   739
     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
   740
     simulated here."
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   741
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   742
    |val|
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   743
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   744
    val := self at:aKey ifAbsent:nil.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   745
    val isNil ifTrue:[^ exceptionBlock value].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   746
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   747
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   748
    "Created: / 18.6.1998 / 17:05:24 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   749
!
3610
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   750
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   751
at:aKey
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   752
    "retrieve the value stored under aKey, a symbol. 
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   753
     Return nil if not present 
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   754
     (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
   755
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   756
    aKey class == String ifTrue:[self error:'expected symbol'].
6080
15ea3cbf6003 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   757
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   758
%{  /* NOCONTEXT */
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   759
    RETURN ( __GLOBAL_GET(aKey) );
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   760
%}.
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   761
    ^ self primitiveFailed
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   762
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   763
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   764
at:aKey ifAbsent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   765
    "retrieve the value stored at aKey.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
   766
     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
   767
     the evaluation of aBlock."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   768
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   769
    (self includesKey:aKey) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   770
        ^ self at:aKey
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   771
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   772
    ^ aBlock value
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   773
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   774
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   775
     Smalltalk at:#fooBar                       <- returns nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   776
     Smalltalk at:#fooBar ifAbsent:['sorry']    <- no error
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   777
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   778
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   779
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   780
at:aKey ifPresent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   781
    "try to retrieve the value stored at aKey.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   782
     If there is nothing stored under this key, do nothing.
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   783
     Otherwise, evaluate aBlock, passing the retrieved value as argument."
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   784
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   785
    (self includesKey:aKey) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   786
        ^ aBlock value:(self at:aKey)
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   787
    ].
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   788
    ^ nil
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   789
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   790
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   791
     Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   792
     Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   793
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   794
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   795
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   796
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   797
at:aKey put:aValue
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   798
    "store the argument aValue under aKey, a symbol.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   799
     Return aValue (sigh)."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   800
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   801
    |oldValue|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   802
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   803
%{
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   804
    oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0);
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   805
%}.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   806
    CachedClasses notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   807
        oldValue isBehavior ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   808
            oldValue name == aKey ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   809
                CachedClasses remove:oldValue ifAbsent:[]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   810
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   811
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   812
        aValue isBehavior ifTrue:[
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   813
"/            aValue isMeta ifTrue:[
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   814
"/                "/ this should not happen
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   815
"/                ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR.
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   816
"/            ].
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   817
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   818
            aValue name == aKey ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   819
                CachedClasses add:aValue
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   820
            ] ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   821
                CachedClasses := nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   822
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   823
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   824
    ].
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   825
    ^ aValue.
1955
276d4ce9b40e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   826
"/
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   827
"/%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   828
"/    (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   829
"/%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   830
"/    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   831
"/    ^ aValue
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   832
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   833
    "Modified: 19.4.1996 / 11:31:49 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   834
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   835
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   836
includesKey:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   837
    "return true, if the key is known"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   838
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   839
    "/ for debugging - this is a common mistake,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   840
    "/ to try to access a class by nameString, instead
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   841
    "/ of by symbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   842
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   843
    "/ aKey class == String ifTrue:[self halt].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   844
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   845
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   846
    RETURN ( __GLOBAL_KEYKNOWN(aKey) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   847
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   848
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   849
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   850
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   851
keyAtValue:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   852
    "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
   853
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   854
    self keysDo:[:aKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   855
        (self at:aKey) == anObject ifTrue:[^ aKey]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   856
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   857
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   858
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   859
    "Smalltalk keyAtValue:Object"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   860
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   861
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   862
keys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   863
    "return a collection with all keys in the Smalltalk dictionary"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   864
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   865
    |keys|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   866
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   867
    keys := IdentitySet new.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   868
    self keysDo:[:k | keys add:k].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   869
    ^ keys
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   870
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   871
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   872
removeKey:aKey
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   873
    "remove the association stored under the key-argument from the globals dictionary.
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
   874
     WARNING: 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   875
        this is somewhat dangerous: conceptionally, the association is removed,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   876
        to which machine & byte compiled code refers if it accesses a global.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   877
        If there are still global accesses in some literalArray or from machine-compiled code,
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   878
        it continues to reference the globals value via that obsolete association and gets a nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   879
        value.  (which is correct)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   880
        However, if that global is later reintroduced, a new association will be created and
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   881
        the new global now referenced via the new association.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   882
        The old accesses will still see nil, although the globals value is actually non-nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   883
        (this is questionable).
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   884
        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
   885
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   886
    CachedClasses := nil.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   887
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   888
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   889
    RETURN ( __GLOBAL_REMOVE(aKey) );
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
    ^ self primitiveFailed
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
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   894
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   895
values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   896
    "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
   897
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   898
    |values|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   899
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   900
    values := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   901
    self do:[:v | values add:v].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   902
    ^ values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   903
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   904
    "Created: 20.6.1997 / 16:58:28 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   905
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   906
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   907
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   908
!Smalltalk class methodsFor:'browsing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   909
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   910
browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   911
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   912
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   913
    "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
   914
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   915
    UserPreferences systemBrowserClass browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   916
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   917
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   918
     Smalltalk browseAllCallsOn:#at:put: 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   919
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   920
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   921
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   922
browseAllSelect:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   923
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   924
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   925
    "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
   926
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
   927
    UserPreferences systemBrowserClass browseAllSelect:aBlock
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   928
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   929
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   930
     Smalltalk browseAllSelect:[:m | m literals isNil]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   931
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   932
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   933
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   934
browseChanges
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   935
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   936
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   937
    "startup a changes browser"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   938
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   939
    ChangesBrowser notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   940
        ChangesBrowser open
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   941
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
   942
        self warn:'no ChangesBrowser built in'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   943
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   944
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   945
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   946
     Smalltalk browseChanges
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   947
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   948
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   949
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   950
browseClass:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   951
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   952
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   953
    "startup a browser on aClass"
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   954
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   955
    UserPreferences systemBrowserClass browseClass:aClass
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   956
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   957
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   958
     Smalltalk browseClass:Array 
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   959
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   960
!
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   961
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   962
browseImplementorsMatching:aSelectorSymbolOrMatchPattern
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   963
    "{ Pragma: +optSpace }"
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   964
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   965
    "startup a browser for all methods implementing a message matching"
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   966
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   967
    UserPreferences systemBrowserClass browseImplementorsMatching:aSelectorSymbolOrMatchPattern
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   968
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   969
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   970
     Smalltalk browseImplementorsOf:#'at:put:' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   971
     Smalltalk browseImplementorsMatching:#'at:*' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   972
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   973
!
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   974
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   975
browseImplementorsOf:aSelectorSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   976
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   977
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   978
    "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
   979
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
   980
    UserPreferences systemBrowserClass browseImplementorsOf:aSelectorSymbol
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   981
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   982
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   983
     Smalltalk browseImplementorsOf:#at:put: 
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   984
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   985
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   986
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   987
browseInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   988
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   989
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   990
    "startup a full browser showing aClass"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   991
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   992
    UserPreferences systemBrowserClass openInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   993
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   994
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   995
     Smalltalk browseInClass:Array 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   996
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   997
!
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   998
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   999
browseInClass:aClass selector:selector
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1000
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1001
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1002
    "startup a full browser showing aClass>>selector"
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1003
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1004
    UserPreferences systemBrowserClass openInClass:aClass selector:selector
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1005
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1006
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1007
     Smalltalk browseInClass:Array selector:#at:
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1008
    "
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1009
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1010
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1011
!Smalltalk class methodsFor:'class management'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1012
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1013
changeCategoryOf:aClass to:newCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1014
    "change a classes category, add a change record,
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1015
     send change notifications"
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1016
8405
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1017
    |ns oldCategory|
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1018
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1019
    oldCategory := aClass category.
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1020
    oldCategory ~= newCategory ifTrue:[
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1021
        aClass category:(newCategory withoutSeparators asSymbol). 
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1022
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1023
        "notify change of category"
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1024
        ns := aClass environment ? self.
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1025
        ns changed:#organization with:(aClass -> oldCategory).
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1026
        ns ~~ self ifTrue:[
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1027
            self changed:#organization with:(aClass -> oldCategory).
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1028
        ]
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1029
    ].
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1030
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1031
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1032
     Smalltalk changeCategoryOf:NewApplication to:#myApplications
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1033
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1034
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1035
    "Modified: / 11.2.2000 / 11:36:27 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1036
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1037
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1038
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
  1039
    NameSpace name:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1040
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1041
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1042
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1043
flushCachedClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1044
    CachedClasses notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1045
        CachedClasses remove:aClass ifAbsent:[]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1046
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1047
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1048
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1049
flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1050
    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1051
    Class flushSubclassInfo.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1052
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1053
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1054
     Smalltalk flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1055
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1056
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1057
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1058
removeClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1059
    "remove the argument, aClass from the smalltalk dictionary;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1060
     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
  1061
     Also, class variables of aClass are removed."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1062
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1063
    |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
  1064
4099
f6984fc5cb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4096
diff changeset
  1065
    aClass isNil ifTrue:[^ self].
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1066
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1067
    oldName := aClass name.
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1068
    sym := oldNameSym := oldName asSymbol.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1069
    ((self at:oldNameSym) == aClass) ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1070
        "check other name ..."
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1071
        (self includes:aClass) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1072
            'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1073
            ^ self
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1074
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1075
        "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1076
         the class has changed its name - without telling me ...
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1077
         what should be done in this case ?
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1078
        "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1079
        'Smalltalk [warning]: class ' errorPrint. oldName errorPrint.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1080
        ' has changed its name' errorPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1081
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1082
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1083
        "/ might be an alias (i.e. removing a compatibility name)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1084
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1085
        actualName := self keyAtValue:aClass.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1086
        ('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1087
        sym := actualName asSymbol.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1088
        oldName := actualName asString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1089
        wrongName := true.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1090
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1091
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1092
    ns := aClass nameSpace.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1093
    aClass topOwningClass notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1094
        ons := aClass topOwningClass nameSpace
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1095
    ].
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1096
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1097
    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
  1098
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1099
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1100
    "/ 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
  1101
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1102
    "/ self removeKey:sym.     "/ remove key - this actually fails, if there are
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1103
                               "/ still compiled code references."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1104
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1105
    "remove private classes"
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1106
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1107
    aClass privateClassesSorted do:[:somePrivateClass |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1108
        aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil.
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1109
    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1110
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1111
    "remove class variables"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1112
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1113
    names := aClass classVariableString asCollectionOfWords.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1114
    names do:[:name |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1115
        cSym := (sym , ':' , name) asSymbol.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1116
        self at:cSym asSymbol put:nil.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1117
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1118
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1119
        "/ see comment in removeKey: on why we dont remove it here
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1120
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1121
        "/ self removeKey:cSym
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1122
    ].
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1123
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1124
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1125
"/    actually could get along with less flushing
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1126
"/    (entries for aClass and subclasses only)
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1127
"/    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
  1128
"/    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
  1129
"/    expensive then cache flushing.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1130
"/
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1131
"/    aClass allSubclassesDo:[:aSubclass |
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1132
"/        ObjectMemory flushInlineCachesForClass:aSubclass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1133
"/        ObjectMemory flushMethodCacheFor:aSubclass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1134
"/    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1135
"/    ObjectMemory flushInlineCachesForClass:aClass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1136
"/    ObjectMemory flushMethodCacheFor:aClass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1137
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1138
    ObjectMemory flushInlineCaches.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1139
    ObjectMemory flushMethodCache.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1140
7181
7382117bf3fa james' package changes
james
parents: 7126
diff changeset
  1141
    aClass addChangeRecordForClassRemove.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1142
    self changed:#classRemove with:aClass.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1143
7581
6912a7336e15 class category: sends a change notification;
Claus Gittinger <cg@exept.de>
parents: 7572
diff changeset
  1144
    aClass setCategory:#'* removed *'.
1655
fb6ee1b55ec4 use *-categories
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  1145
5326
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1146
    self flushCachedClasses.
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1147
    Class flushSubclassInfo.
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1148
3627
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1149
    wrongName == true ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1150
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1151
        "/ an alias (i.e. removing a compatibility name)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1152
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1153
        "/ check if there are more refs to it ...
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1154
        [self includes:aClass] whileTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1155
            actualName := self keyAtValue:aClass.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1156
            ('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1157
                          , ' - remove that binding too.') infoPrintCR.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1158
            self at:actualName put:nil.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1159
        ].
4724
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1160
    ].
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1161
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1162
    ns ~~ Smalltalk ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1163
        ons notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1164
            ClassBuilder
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1165
                recompileGlobalAccessorsTo:oldNameSym
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1166
                in:ons
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1167
                except:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1168
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1169
        (ns notNil and:[ns ~~ ons]) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1170
            ClassBuilder
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1171
                recompileGlobalAccessorsTo:oldNameSym
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1172
                in:ns
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1173
                except:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1174
        ].
3627
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1175
    ].
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1176
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1177
    "Modified: / 20.6.1998 / 13:26:10 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1178
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1179
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1180
renameClass:aClass to:newName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1181
    "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
  1182
     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
  1183
     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
  1184
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1185
    |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
  1186
     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
  1187
     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
  1188
     oldMetaclass newMetaclass newCategory|
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1189
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1190
    "/ check for all intermediate namespaces / owning classes
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1191
    i1 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1192
    i2 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1193
    ns := self.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1194
    [i2 ~~ 0] whileTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1195
        i2 := newName indexOfSubCollection:'::' startingAt:i1.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1196
        i2 ~~ 0 ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1197
            nm := newName copyFrom:i1 to:i2-1.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1198
            ns isNameSpace ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1199
                subns := ns at:nm asSymbol ifAbsent:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1200
                subns isNil ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1201
                    self error:'Nonexisting namespace: ',nm.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1202
                    ^ nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1203
                ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1204
            ] ifFalse:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1205
                subns := ns privateClassesAt:nm asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1206
                subns isNil ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1207
                    self error:'Cannot create a namespace below a class'
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1208
                ]
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1209
            ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1210
            ns := subns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1211
            i1 := i2 + 2.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1212
        ].
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1213
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1214
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1215
    oldName := aClass name.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1216
    oldNameSpace := aClass topNameSpace.
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1217
    oldBaseName := aClass nameWithoutNameSpacePrefix.
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1218
    oldBaseNameWithoutPrefix := aClass nameWithoutPrefix.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1219
    oldSym := oldName asSymbol.
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1220
    privateClasses := aClass privateClassesSorted.
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1221
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1222
    ((self at:oldSym) ~~ aClass) ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1223
        'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1224
        ^ self
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1225
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1226
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1227
    "/ rename the class
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1228
1847
6e567214b167 care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  1229
    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
  1230
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1231
    "/ change the owning class
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1232
    ns isNameSpace ifFalse:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1233
        aClass isPrivate ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1234
            aClass class setOwningClass:ns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1235
        ] ifFalse:[
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1236
            "/ sigh - must make a PrivateMetaclass from Metaclass
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1237
            oldMetaclass := aClass class.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1238
            newMetaclass := PrivateMetaclass new.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1239
            newMetaclass flags:(oldMetaclass flags).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1240
            newMetaclass setSuperclass:(oldMetaclass superclass).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1241
            newMetaclass instSize:(oldMetaclass instSize).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1242
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1243
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1244
            newMetaclass setSoleInstance:aClass.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1245
            newMetaclass setOwningClass:ns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1246
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1247
            aClass changeClassTo:newMetaclass.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1248
            ObjectMemory flushCaches.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1249
        ]
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1250
    ] ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1251
        aClass isPrivate ifTrue:[
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1252
            newCategory := aClass topOwningClass category.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1253
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1254
            "/ sigh - must make a Metaclass from PrivateMetaclass
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1255
            oldMetaclass := aClass class.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1256
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1257
            newMetaclass := Metaclass new.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1258
            newMetaclass flags:(oldMetaclass flags).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1259
            newMetaclass setSuperclass:(oldMetaclass superclass).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1260
            newMetaclass instSize:(oldMetaclass instSize).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1261
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1262
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1263
            newMetaclass setSoleInstance:aClass.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1264
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1265
            aClass category:newCategory.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1266
            aClass changeClassTo:newMetaclass.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1267
            ObjectMemory flushCaches.
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1268
        ]        
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1269
    ].
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1270
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1271
    aClass setName:newSym.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1272
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1273
    "/ store it in Smalltalk
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1274
    self at:oldSym put:nil.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1275
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1276
    "/
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1277
    "/ 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
  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
    "/ self removeKey:oldSym.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1280
    self at:newSym put:aClass.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1281
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1282
    "/ 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
  1283
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1284
    oldNameToNewName := IdentityDictionary new.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1285
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1286
    names := aClass classVariableString asCollectionOfWords.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1287
    names do:[:name |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1288
        oldCVSym := (oldSym , ':' , name) asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1289
        value := self at:oldCVSym.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1290
        self at:oldCVSym put:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1291
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1292
        "/
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1293
        "/ see comment in #removeKey: on why we dont remove it it here
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1294
        "/
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1295
        "/ self removeKey:cSym.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1296
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1297
        newCVSym := (newSym , ':' , name) asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1298
        self at:newCVSym put:value.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1299
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1300
        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
  1301
    ].
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1302
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1303
    "/ 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
  1304
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1305
    oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1306
        aClass withAllSubclasses do:[:aSubClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1307
            Transcript showCR:'changing global accesses from ''' , oldNameSym , ''' into ''' , newNameSym , ''' in class: ''' , aSubClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1308
            aSubClass instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1309
                aMethod changeLiteral:oldNameSym to:newNameSym
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1310
            ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1311
        ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1312
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1313
        "/ and also in privateClasses ? ...
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1314
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1315
"/        privateClasses size > 0 ifTrue:[
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1316
"/            privateClasses do:[:aPrivateClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1317
"/                aPrivateClass withAllSubclasses do:[:aSubClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1318
"/                    aSubClass class methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1319
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1320
"/                    ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1321
"/                    aSubClass methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1322
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1323
"/                    ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1324
"/                ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1325
"/            ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1326
"/        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1327
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1328
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1329
    aClass addChangeRecordForClassRename:oldSym to:newSym.
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1330
5333
d80386e06d21 rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
  1331
    "/ 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
  1332
    aClass setEnvironment:nil.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1333
    newNameSpace := aClass topNameSpace.
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1334
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1335
    privateClasses size > 0 ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1336
        "/ must rename privateClasses as well
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1337
        Class withoutUpdatingChangesDo:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1338
            privateClasses do:[:aPrivateClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1339
                self renameClass:aPrivateClass
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1340
                     to:(newSym , '::' , aPrivateClass nameWithoutPrefix).
5916
4364f9ae4254 when renaming a class, no changeRecrd for its private-class renames
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
  1341
            
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1342
                Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'.
9822
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1343
                aClass theNonMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol.
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1344
                aClass theMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol.
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1345
                aClass theNonMetaclass recompileMethodsAccessingGlobal:(aPrivateClass nameWithoutPrefix) asSymbol.
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1346
                aClass theMetaclass recompileMethodsAccessingGlobal:(aPrivateClass nameWithoutPrefix) asSymbol.
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1347
"/                ClassBuilder
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1348
"/                    recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol 
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1349
"/                    in:newNameSpace 
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1350
"/                    except:nil.
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1351
            ]
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1352
        ]
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1353
    ].
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1354
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1355
    oldNameSpace ~~ newNameSpace ifTrue:[
5246
2ca7b20c4108 create namespaces as requried, when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5214
diff changeset
  1356
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1357
        "/ all those referencing the class from the old nameSpace
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1358
        "/ must be recompiled ...
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1359
        "/ (to now access the global from smalltalk)
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1360
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1361
        oldNameSpace ~~ Smalltalk ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1362
            Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1363
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1364
            ClassBuilder
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1365
                recompileGlobalAccessorsTo:oldName asSymbol 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1366
                in:oldNameSpace 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1367
                except:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1368
        ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1369
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1370
        "/ all referencing the class in the new namespace
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1371
        "/ as well; to now access the new class.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1372
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1373
        (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1374
            Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1375
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1376
            ClassBuilder
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1377
                recompileGlobalAccessorsTo:oldBaseName asSymbol 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1378
                in:newNameSpace 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1379
                except:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1380
        ].
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1381
    ] ifFalse:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1382
        "/ all references to a global with my new name in my owning class
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1383
        "/ must now be redirected to myself.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1384
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1385
        aClass isPrivate ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1386
            newBaseName := aClass nameWithoutNameSpacePrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1387
            newBaseNameWithoutPrefix := aClass nameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1388
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1389
            Transcript showCR:'recompiling methods accessing ''' , oldBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1390
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1391
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1392
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1393
            Transcript showCR:'recompiling methods accessing ''' , oldBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1394
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1395
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1396
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1397
            Transcript showCR:'recompiling methods accessing ''' , newBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1398
            aClass owningClass recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1399
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1400
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1401
            Transcript showCR:'recompiling methods accessing ''' , newBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1402
            aClass owningClass recompileMethodsAccessingGlobal:newBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1403
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1404
        ]
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1405
    ].
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1406
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1407
    aClass changed:#definition.
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1408
    "/ 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
  1409
    aClass allSubclassesDo:[:subClass |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1410
        subClass changed:#definition.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1411
    ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1412
    "/ 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
  1413
    aClass subclassesDo:[:subClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1414
        subClass addChangeRecordForClass:subClass.
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1415
    ].
5613
b534e427f028 change message when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5611
diff changeset
  1416
    self changed:#definition.
b534e427f028 change message when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5611
diff changeset
  1417
    Smalltalk changed:#classRename with:(Array with:aClass with:oldName).
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1418
9822
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1419
    "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
  1420
    "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
  1421
    "Modified: / 05-09-2006 / 12:52:25 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1422
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1423
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1424
!Smalltalk class methodsFor:'copying'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1425
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1426
deepCopy
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1427
    "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
  1428
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1429
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1430
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1431
    "Modified: 18.5.1996 / 12:13:33 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1432
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1433
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1434
deepCopyUsing:aDictionary
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1435
    "return a deep copy of the receiver.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1436
     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
  1437
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1438
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1439
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1440
    "Modified: 18.5.1996 / 12:13:36 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1441
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1442
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1443
shallowCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1444
    "redefined to return self - there is only one Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1445
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1446
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1447
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1448
    "Modified: 18.5.1996 / 12:13:39 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1449
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1450
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1451
simpleDeepCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1452
    "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
  1453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1454
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1455
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1456
    "Modified: 18.5.1996 / 12:13:42 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1457
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1458
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1459
!Smalltalk class methodsFor:'debugging ST/X'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1460
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1461
compileTrace:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1462
    "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
  1463
%{
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1464
    extern char __compileTrace__;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1465
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1466
    __compileTrace__ = (aBoolean == true) ? 1 : 0;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1467
%}
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1468
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1469
     Smalltalk compileTrace:true
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1470
     Smalltalk compileTrace:false
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1471
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1472
!
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1473
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1474
debugBreakPoint
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1475
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1476
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1477
    "call the dummy debug function, on which a breakpoint
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1478
     can be put in adb, sdb, dbx or gdb.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1479
     WARNING: this method is for debugging only
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1480
              it will be removed without notice."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1481
%{
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1482
    __PATCHUPCONTEXTS(__context);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1483
    __debugBreakPoint__();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1484
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1485
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1486
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1487
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1488
exitWithCoreDump
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1489
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1490
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1491
    "abort program and dump core"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1492
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1493
    OperatingSystem exitWithCoreDump
4096
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1494
    "/ never returns
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1495
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1496
    "Be careful evaluating this
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1497
     Smalltalk exitWithCoreDump
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1498
    "
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1499
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1500
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1501
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1502
fatalAbort
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1503
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1504
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1505
    "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
  1506
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1507
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1508
    __fatal0(__context, "fatalAbort");
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1509
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1510
%}.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1511
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1512
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1513
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1514
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1515
fatalAbort:aMessage
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1516
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1517
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1518
    "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
  1519
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1520
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1521
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1522
    char *msg;
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1523
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1524
    if (__isString(aMessage))
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1525
        msg = (char *) __stringVal(aMessage);
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1526
    else
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1527
        msg = "fatalAbort";
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1528
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1529
    __fatal0(__context, msg);
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1530
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1531
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1532
    ^ self primitiveFailed
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1533
5441
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1534
!
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1535
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1536
vmInstructionTrace:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1537
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1538
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1539
! !
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1540
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1541
!Smalltalk class methodsFor:'enumerating'!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1542
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1543
allBehaviorsDo:aBlock
5580
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1544
    "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
  1545
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1546
    self allClassesAndMetaclassesDo:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1547
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1548
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1549
     Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1550
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1551
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1552
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1553
allClassCategories
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1554
    "return a set of all class categories in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1555
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1556
    |allCategories|
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1557
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1558
    allCategories := Set new.
7124
da253fd03ba1 Do not sort categories in #allClassCategories.
Stefan Vogel <sv@exept.de>
parents: 7105
diff changeset
  1559
    Smalltalk allClassesDo:[:cls | |category|
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1560
        category := cls category.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1561
        category notNil ifTrue:[    
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1562
            allCategories add:category.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1563
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1564
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1565
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1566
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1567
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1568
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1569
     Smalltalk allClassCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1570
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1571
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1572
    "Created: / 17.11.2001 / 12:13:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1573
!
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1574
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1575
allClassesAndMetaclassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1576
    "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
  1577
5940
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1578
    |already|
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1579
9259
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1580
    already := IdentitySet new:NumberOfClassesHint*3.
5940
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1581
    self allClassesDo:[:eachClass | |cls|
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1582
        cls := eachClass theNonMetaclass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1583
        (already includes:cls) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1584
            aBlock value:cls.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1585
            already add:cls.    
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1586
        ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1587
        cls := cls class.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1588
        (already includes:cls) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1589
            aBlock value:cls.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1590
            already add:cls.    
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1591
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1592
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1593
!
5579
26af506d271e added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents: 5550
diff changeset
  1594
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1595
allClassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1596
    "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
  1597
5765
152a485288d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5760
diff changeset
  1598
    self allClasses do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1599
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1600
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1601
     Smalltalk allClassesDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1602
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1603
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1604
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1605
allClassesForWhich:filter
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1606
    "return a collection with all classes in the system, 
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1607
     for which filter evaluates to true."
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1608
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1609
    |collectedClasses|
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1610
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1611
    collectedClasses := OrderedCollection new.
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1612
    self allClassesForWhich:filter do:[:cls |
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1613
        collectedClasses add:cls
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1614
    ].
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1615
    ^ collectedClasses
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1616
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1617
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1618
     Smalltalk 
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1619
        allClassesForWhich:[:cls | cls name startsWith:'Po'] 
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1620
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1621
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1622
    "Created: / 10-08-2006 / 12:11:31 / cg"
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1623
!
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1624
9292
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1625
allClassesForWhich:filter do:aBlock
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1626
    "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
  1627
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1628
    self allClassesDo:[:cls |
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1629
        (filter value:cls) ifTrue:[ aBlock value:cls ].
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1630
    ].
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1631
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1632
    "
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1633
     Smalltalk 
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1634
        allClassesForWhich:[:cls | cls name startsWith:'Po'] 
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1635
        do:[:aClass | Transcript showCR:aClass name]
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1636
    "
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1637
!
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1638
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1639
allClassesInCategory:aCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1640
    "return a collection of for all classes in aCategory;
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1641
     The order of the classes is not defined."
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1642
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1643
    ^ self allClassesForWhich:[:cls | cls category = aCategory]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1644
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1645
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1646
     Smalltalk allClassesInCategory:'Views-Basic'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1647
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1648
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1649
    "Modified: / 10-08-2006 / 12:13:32 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1650
!
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1651
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1652
allClassesInCategory:aCategory do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1653
    "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
  1654
     The order of the classes is not defined."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1655
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1656
    aCategory notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1657
        self allClassesForWhich:[:cls | cls category = aCategory] do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1658
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1659
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1660
    "
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1661
     Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | Transcript showCR:aClass]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1662
    "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1663
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1664
    "Modified: / 09-08-2006 / 17:18:50 / fm"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1665
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1666
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1667
allClassesInCategory:aCategory inOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1668
    "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
  1669
     superclasses come first - then subclasses"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1670
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1671
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1672
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1673
    aCategory notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1674
        classes := OrderedCollection new.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1675
        self allClassesInCategory:aCategory do:[:aClass |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1676
            classes add:aClass
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1677
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1678
        classes topologicalSort:[:a :b | b isSubclassOf:a].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1679
        classes do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1680
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1681
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1682
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1683
     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
  1684
    "
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1685
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1686
    "Modified: / 17.11.2001 / 12:18:15 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1687
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1688
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1689
allClassesInOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1690
    "evaluate the argument, aBlock for all classes in the system;
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1691
     Evaluation order is by inheritance: superclasses come first."
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1692
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1693
    |already|
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1694
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1695
    already := IdentitySet new:NumberOfClassesHint.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1696
    self allClassesDo:[:eachClass |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1697
        (already includes:eachClass) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1698
            eachClass allSuperclasses reverseDo:[:eachSuperClass |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1699
                (already includes:eachSuperClass) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1700
                    already add:eachSuperClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1701
                    aBlock value:eachSuperClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1702
                ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1703
            ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1704
            already add:eachClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1705
            aBlock value:eachClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1706
        ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1707
    ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1708
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1709
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1710
     Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name]
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1711
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1712
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1713
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1714
allClassesInPackage:aPackageID
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1715
    "evaluate the argument, aBlock for all classes a package;
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1716
     The order of the classes is not defined."
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1717
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1718
    ^ self allClassesForWhich:[:cls | cls package = aPackageID]
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1719
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1720
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1721
     Smalltalk allClassesInPackage:'bosch:dapasx' 
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1722
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1723
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1724
    "Created: / 10-08-2006 / 12:14:10 / cg"
9512
2b8f083283b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9511
diff changeset
  1725
    "Modified: / 10-08-2006 / 13:45:43 / cg"
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1726
!
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1727
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1728
allClassesInPackage:aPackageID do:aBlock
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1729
    "evaluate the argument, aBlock for all classes a package;
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1730
     The order of the classes is not defined."
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1731
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1732
    ^ self allClassesForWhich:[:cls | cls package = aPackageID] do:aBlock
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1733
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1734
    "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1735
     Smalltalk allClassesInPackage:'bosch:dapasx' do:[:aClass | Transcript showCR:aClass] 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1736
    "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1737
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1738
    "Created: / 09-08-2006 / 17:14:17 / fm"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1739
!
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1740
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1741
allKeysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1742
    "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
  1743
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1744
    ^ self keysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1745
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1746
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1747
allMethodCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1748
    "return a set of all method categories in the system"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1749
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1750
    |allCategories|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1751
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1752
    allCategories := Set new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1753
    Smalltalk allClassesDo:[:cls |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1754
        allCategories addAll:cls categories.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1755
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1756
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1757
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1758
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1759
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1760
     Smalltalk allMethodCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1761
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1762
!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
  1763
9259
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1764
allMethodsDo:aBlock
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1765
    Smalltalk allClassesDo:[:eachClass |
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1766
        eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1767
            aBlock value:mthd
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1768
        ]
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1769
    ].
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1770
!
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1771
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1772
associationsDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1773
    "evaluate the argument, aBlock for all key/value pairs 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1774
     in the Smalltalk dictionary"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1775
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1776
    self keysDo:[:aKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1777
        aBlock value:(aKey -> (self at:aKey))
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1778
    ]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1779
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1780
    "Smalltalk associationsDo:[:assoc | assoc printCR]"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1781
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1782
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1783
basicKeys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1784
    "for rel > 5 only"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1785
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1786
    self primitiveFailed
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1787
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1788
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1789
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1790
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1791
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1792
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1793
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1794
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1795
do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1796
    "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
  1797
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1798
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1799
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1800
%{  /* 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
  1801
    __GLOBALS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1802
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1803
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1804
    self keysDo:[:aKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1805
        aBlock value:(self at:aKey)
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1806
    ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1807
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1808
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1809
keysAndValuesDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1810
    "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
  1811
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1812
    self keysDo:[:aKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1813
        aBlock value:aKey value:(self at:aKey)
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1814
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1815
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1816
9077
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1817
keysAndValuesSelect:selectBlockWith2Args thenCollect:collectBlockWith2Args
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1818
    |collected|
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1819
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1820
    collected := OrderedCollection new.
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1821
    self keysAndValuesDo:[:eachKey :eachValue |
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1822
        (selectBlockWith2Args value:eachKey value:eachValue) ifTrue:[
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1823
            collected add:(collectBlockWith2Args value:eachKey value:eachValue)
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1824
        ].
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1825
    ].
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1826
    ^ collected
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1827
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1828
    "
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1829
     Smalltalk 
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1830
        keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]] 
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1831
        thenCollect:[:nm :val | nm]
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1832
    "
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1833
!
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  1834
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1835
keysDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1836
    "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
  1837
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1838
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1839
%{  /* 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
  1840
    __GLOBALKEYS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1841
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1842
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1843
    self basicKeys do:[:aKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1844
        aBlock value:aKey
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1845
    ]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1846
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1847
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1848
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1849
!Smalltalk class methodsFor:'message control'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1850
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1851
silentLoading
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1852
    "returns the Silentloading class variable."
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1853
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1854
     ^ SilentLoading
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1855
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1856
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1857
silentLoading:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1858
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1859
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1860
    "allows access to the Silentloading class variable, which controls
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1861
     messages from all kinds of system onto the transcript.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1862
     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
  1863
     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
  1864
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1865
    |prev|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1866
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1867
    prev := SilentLoading.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1868
    SilentLoading := aBoolean.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1869
    ^ prev
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1870
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1871
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1872
!Smalltalk class methodsFor:'misc accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1873
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1874
beHeadless:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1875
    "set/clear the headlessOperation flag."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1876
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1877
    HeadlessOperation := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1878
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1879
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1880
standAloneApp:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1881
    "set/clear the StandAlone flag."
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
    StandAlone := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1884
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1885
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1886
!Smalltalk class methodsFor:'misc stuff'!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1887
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1888
addExitBlock:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1889
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1890
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1891
    "add a block to be executed when Smalltalk finishes.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1892
     This feature is currently not used anywhere - but could be useful for
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1893
     cleanup in stand alone applications."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1894
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1895
    ExitBlocks isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1896
        ExitBlocks := OrderedCollection with:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1897
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1898
        ExitBlocks add:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1899
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1900
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1901
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1902
addImageStartBlock:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1903
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1904
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1905
    "add a blocks to be executed in a separate process after
2681
0de96fb520ac commentary
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1906
     everything has been initialized. 
0de96fb520ac commentary
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1907
     These blocks will be executed after an image restart."
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1908
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1909
    ImageStartBlocks isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1910
        ImageStartBlocks := OrderedCollection with:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1911
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1912
        ImageStartBlocks add:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1913
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1914
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1915
    "Created: 9.9.1996 / 16:48:20 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1916
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1917
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1918
addStartBlock:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1919
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1920
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1921
    "add a blocks to be executed in a separate process after
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1922
     everything has been initialized. These blocks will
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1923
     be deleted after execution and therefore not be
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1924
     executed after an image restart. 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1925
     Initial processes are usually started here (see smalltalk.rc / private.rc)."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1926
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1927
    StartBlocks isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1928
        StartBlocks := OrderedCollection with:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1929
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1930
        StartBlocks add:aBlock
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1931
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1932
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1933
    "Created: 9.9.1996 / 16:46:53 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1934
!
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1935
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1936
exit
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1937
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1938
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1939
    "finish the Smalltalk system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1940
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1941
    self exit:0
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1942
    "not reached"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1943
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1944
    "Be careful evaluating this
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1945
     Smalltalk exit
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1946
    "
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1947
!
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1948
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1949
exit:statusInteger
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1950
    "{ Pragma: +optSpace }"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1951
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1952
    "finish the Smalltalk system"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1953
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1954
    ObjectMemory changed:#aboutToExit.  "/ for ST/X backward compatibility
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1955
    ObjectMemory changed:#aboutToQuit.  "/ for ST-80 compatibility
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1956
    ExitBlocks notNil ifTrue:[
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1957
        ExitBlocks do:[:aBlock |
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1958
            aBlock value
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1959
        ]
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1960
    ].
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1961
    OperatingSystem exit:statusInteger
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1962
    "not reached"
4096
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1963
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1964
    "Be careful evaluating this
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1965
     Smalltalk exit:1
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1966
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1967
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1968
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1969
!Smalltalk class methodsFor:'queries'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1970
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1971
allClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1972
    "return an unordered collection of all classes in the system.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1973
     Only globally anchored classes are returned 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1974
     (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
  1975
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1976
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1977
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1978
    "/ 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
  1979
    "/ the reason is that if we modify the class hierarchy in
4067
732848627915 comment
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
  1980
    "/ another view (background fileIn), while building up the
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1981
    "/ cachedClasses set, this may be flushed (invalidated) by the
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1982
    "/ other process in the meanwhile.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1983
    "/ If that happens, we restart the set-building here
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1984
    "/
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1985
    [(classes := CachedClasses) isNil] whileTrue:[
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1986
        CachedClasses := classes := IdentitySet new:NumberOfClassesHint. 
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1987
        self keysAndValuesDo:[:eachName :eachGlobal |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1988
            (eachGlobal notNil and:[eachGlobal isBehavior]) ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1989
                "/ sigh - would like to skip over aliases
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1990
                "/ but this cannot be done simply by comparing
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1991
                "/ the classes name against the store-key
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1992
                "/ i.e. cannot do:
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1993
                "/      anObject name == sym ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1994
                "/          classes add:anObject
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1995
                "/      ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1996
                "/ because that would lead to ignore all java
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1997
                "/ classes, which are stored under a different
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1998
                "/ key.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1999
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2000
                (eachGlobal name == eachName
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2001
                 or:[eachGlobal isJavaClass]) ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2002
                    classes add:eachGlobal
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2003
                ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2004
            ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2005
        ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2006
        NumberOfClassesHint := classes size.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2007
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2008
    ^ classes
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2009
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2010
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2011
     CachedClasses := nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2012
     Smalltalk allClasses
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2013
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2014
    to get the list sorted by name:
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2015
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2016
     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
  2017
    "
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2018
5278
ae041ee44fd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
  2019
    "Modified: / 23.2.2000 / 10:49:46 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2020
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2021
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2022
allClassesAndMetaclasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2023
    "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
  2024
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2025
    |classes|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2026
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2027
    classes := IdentitySet new:NumberOfClassesHint*2.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2028
    self allClassesDo:[:eachClass |
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2029
        classes add:(eachClass theNonMetaclass).
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2030
        classes add:(eachClass theMetaclass).
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2031
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2032
    ^ classes
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2033
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2034
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2035
allClassesWithAllPrivateClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2036
    "return an unordered collection of all classes in the Smalltalk namespace.
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2037
     Only globally anchored classes are returned 
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2038
     (i.e. anonymous ones have to be aquired by Behavior allSubInstances)"
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2039
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2040
    ^ self allClasses select:[:aClass | 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2041
            |owner|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2042
9674
80c71c0927ea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9660
diff changeset
  2043
            (aClass isNameSpace not or:[aClass == Smalltalk])
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2044
            and:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2045
                owner := aClass topOwningClass.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2046
                (owner ? aClass) nameSpace == Smalltalk
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2047
            ]
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2048
      ]
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2049
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2050
    "
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2051
     Smalltalk allClassesWithAllPrivateClasses
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2052
    "
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2053
!
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2054
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2055
allImplementorsOf:aSelector
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2056
    |implementors|
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2057
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2058
    implementors := OrderedCollection new.
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2059
    self allClassesDo:[:cls |
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2060
        (cls includesSelector:aSelector) ifTrue:[
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2061
            implementors add:cls.
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2062
        ].
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2063
        (cls class includesSelector:aSelector) ifTrue:[
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2064
            implementors add:cls class.
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2065
        ].
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2066
    ].
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2067
    ^ implementors
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2068
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2069
    "
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2070
     Smalltalk allImplementorsOf:#isNil 
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2071
     (Smalltalk allImplementorsOf:#add:) size 
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2072
    "
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2073
!
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2074
9254
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2075
allProjectIDs
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2076
    |allProjects|
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2077
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2078
    allProjects := Set new.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2079
    self allClassesDo:[:eachClass |
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2080
        |cls pkg|
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2081
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2082
        cls := eachClass theNonMetaclass.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2083
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2084
        pkg := cls package.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2085
        pkg "withoutSeparators" size > 0 ifTrue:[
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2086
            allProjects add:pkg.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2087
        ] ifFalse:[
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2088
            "/ for now, nameSpaces are not in any package;
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2089
            "/ this might change. Then, 0-sized packages are
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2090
            "/ illegal, and the following should be enabled.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2091
            "/ self halt
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2092
        ].
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2093
        cls isJavaClass ifFalse:[
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2094
            cls instAndClassSelectorsAndMethodsDo:[:sel :mthd |
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2095
                allProjects add:mthd package asSymbol.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2096
            ].
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2097
        ].
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2098
    ].
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2099
    allProjects := allProjects asOrderedCollection sort.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2100
    ^ allProjects
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2101
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2102
    "
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2103
     Smalltalk allProjectIDs
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2104
    "
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2105
!
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2106
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2107
cellAt:aName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2108
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2109
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2110
    "return the address of a global cell
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2111
     - used internally for compiler only"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2112
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2113
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2114
    RETURN ( __GLOBAL_GETCELL(aName) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2115
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2116
    ^ self primitiveFailed
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
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2119
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2120
classCategoryCompletion:aPartialCategory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2121
    "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
  2122
     2 entries: 1st: the best (longest) match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2123
                2nd: collection consisting of matching categories"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2124
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2125
    ^ DoWhatIMeanSupport classCategoryCompletion:aPartialCategory inEnvironment:self
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2126
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2127
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2128
     Smalltalk classCategoryCompletion:'Sys'            
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2129
     Smalltalk classCategoryCompletion:'System'              
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2130
     Smalltalk classCategoryCompletion:'System-BinaryStorage' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2131
    "
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2132
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2133
    "Modified: / 10-08-2006 / 13:06:34 / cg"
8583
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
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2136
classNamed:aString
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2137
    "return the class with name aString, or nil if absent.
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2138
     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
  2139
     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
  2140
     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
  2141
     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
  2142
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2143
    |cls sym nonMeta idx prefix rest namespace|
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2144
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2145
    "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
  2146
     But be careful, to not invent new symbols ..."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2147
    sym := aString asSymbolIfInterned.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2148
    sym notNil ifTrue:[
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2149
        cls := self at:sym ifAbsent:nil.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2150
        cls isBehavior ifTrue:[^ cls].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2151
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2152
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2153
    (aString endsWith:' class') ifTrue:[
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2154
        nonMeta := self classNamed:(aString copyWithoutLast:6).
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2155
        nonMeta notNil ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2156
            ^ nonMeta theMetaclass
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2157
        ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2158
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2159
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2160
    "no success yet. Try if this is a private classes of an autoloaded class"
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2161
    cls isNil ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2162
        idx := aString indexOfSubCollection:'::'.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2163
        idx ~~ 0 ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2164
            prefix := aString copyTo:idx-1.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2165
            rest := aString copyFrom:idx+2.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2166
            namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2167
            "namespace may be the owner of a private class.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2168
             NameSpaces and Behaviors have the same protocol"
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2169
            [namespace isBehavior] whileTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2170
                idx := rest indexOfSubCollection:'::'.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2171
                idx ~~ 0 ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2172
                    prefix := rest copyTo:idx-1.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2173
                    rest := rest copyFrom:idx+2.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2174
                    "this does an implicit autoload if required"
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2175
                    namespace := namespace privateClassesAt:prefix.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2176
                ] ifFalse:[
9468
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2177
                    namespace isLoaded ifTrue:[
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2178
                        cls := namespace privateClassesAt:rest.
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2179
                        cls isBehavior ifTrue:[^ cls].
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2180
                    ].
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2181
                    namespace := nil.   "force exit of loop"
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2182
                ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2183
            ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2184
        ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2185
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2186
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2187
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2188
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2189
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2190
     Smalltalk classNamed:'Object'    
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2191
     Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2192
     Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2193
     Smalltalk classNamed:'Authentication::BasicAuthenticator'    
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2194
     Smalltalk classNamed:'fooBar' 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2195
     Smalltalk classNamed:'true'    
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2196
     Smalltalk classNamed:'Object class'    
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2197
     Smalltalk classNamed:'Metaclass'    
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2198
     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
  2199
     Smalltalk classNamed:'Array class'
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2200
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2201
9468
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2202
    "Created: / 24-11-1995 / 17:30:22 / cg"
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2203
    "Modified: / 19-06-1996 / 14:22:21 / stefan"
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  2204
    "Modified: / 03-08-2006 / 14:01:06 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2205
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2206
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2207
classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2208
    "return a collection of all classNames in the system"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2209
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2210
    ^ self allClasses collect:[:aClass | aClass name]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2211
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2212
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2213
     Smalltalk classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2214
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2215
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2216
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2217
classnameCompletion:aPartialClassName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2218
    "given a partial classname, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2219
     2 entries: 1st: the best (longest) match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2220
                2nd: collection consisting of matching names"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2221
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2222
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2223
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2224
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2225
classnameCompletion:aPartialClassName inEnvironment:anEnvironment
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2226
    "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
  2227
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2228
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2229
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2230
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:anEnvironment
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2231
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2232
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2233
     Smalltalk classnameCompletion:'Arr'     
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2234
     Smalltalk classnameCompletion:'Arra' 
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2235
     Smalltalk classnameCompletion:'arra' 
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2236
     Smalltalk classnameCompletion:'*rray' 
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2237
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2238
     Smalltalk classnameCompletion:'Arr cl'     
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2239
     Smalltalk classnameCompletion:'*rray cl' 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2240
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2241
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2242
    "Created: 24.11.1995 / 17:24:45 / cg"
2523
04db1fd74e0d try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  2243
    "Modified: 3.4.1997 / 18:25:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2244
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2245
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2246
defaultNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2247
    "return the default namespace, where new classes are installed,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2248
     if NO special nameSpace handler is present"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2249
9562
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  2250
    ^ Project defaultNameSpace.
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  2251
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  2252
    "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
  2253
    "Modified: / 17-08-2006 / 14:01:22 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2254
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2255
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2256
globalNameCompletion:aPartialGlobalName
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2257
    "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
  2258
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2259
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2260
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2261
    ^ 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
  2262
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2263
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2264
     Smalltalk globalnameCompletion:'Arr'  
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2265
     Smalltalk globalnameCompletion:'Arra' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2266
     Smalltalk globalnameCompletion:'arra' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2267
     Smalltalk globalnameCompletion:'*rray' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2268
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2269
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2270
    "Created: / 24-11-1995 / 17:24:45 / cg"
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2271
    "Modified: / 10-08-2006 / 13:05:39 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2272
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2273
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2274
globalnameCompletion:aPartialGlobalName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2275
    "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
  2276
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2277
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2278
8358
0afa3ee38c37 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8317
diff changeset
  2279
    <resource:#obsolete>
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2280
    self obsoleteMethodWarning:'use #globalNameCompletion:'.
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2281
    ^ 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
  2282
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2283
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2284
     Smalltalk globalnameCompletion:'Arr'  
5736
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2285
     Smalltalk globalnameCompletion:'Arra' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2286
     Smalltalk globalnameCompletion:'arra' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2287
     Smalltalk globalnameCompletion:'*rray' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2288
    "
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2289
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2290
    "Created: / 24-11-1995 / 17:24:45 / cg"
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2291
    "Modified: / 10-08-2006 / 13:05:48 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2292
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2293
9290
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2294
hasNameSpaces
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2295
    "can be redefined by dummy namespaces/environments, to suppress
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2296
     the namespace display in a browser (PocketSmalltalk)"
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2297
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2298
    ^ true
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2299
!
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2300
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2301
hasNamespaces
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2302
    "can be redefined by dummy namespaces/environments, to suppress
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2303
     the namespace display in a browser (PocketSmalltalk)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2304
9290
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  2305
    <resource:#obsolete>
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2306
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2307
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2308
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2309
includes:something
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2310
    "this should come from Collection.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2311
     will change the inheritance - Smalltalk is actually a collection"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2312
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2313
    self do:[:element | element = something ifTrue:[^ true]].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2314
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2315
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2316
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  2317
isBrowserStartable
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  2318
    ^ false.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  2319
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  2320
    "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
  2321
!
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  2322
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2323
isNameSpace
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2324
    "return true, if the receiver is a nameSpace."
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2325
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2326
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2327
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2328
    "Created: 11.10.1996 / 18:10:43 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2329
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2330
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2331
isTopLevelNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2332
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2333
!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2334
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2335
isTopLevelNamespace
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2336
    "obsolete - use isTopLevelNameSpace"
5365
95c615a40176 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
  2337
7432
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  2338
    <resource:#obsolete>
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  2339
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2340
    self obsoleteMethodWarning:'use #isTopLevelNameSpace'.
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2341
    ^ true
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2342
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2343
    "Created: 11.10.1996 / 18:10:43 / cg"
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2344
!
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2345
9081
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2346
keyIsClassVariableNameKey:aKey
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2347
    |i|
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2348
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2349
    i := aKey lastIndexOf:$:.
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2350
    i ~~ 0 ifTrue:[
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2351
        i > 1 ifTrue:[
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2352
            (aKey at:(i-1)) == $: ifFalse:[
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2353
                ^ true.
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2354
            ].
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2355
        ].
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2356
    ].
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2357
    ^ false.
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2358
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2359
    "
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2360
     self keyIsClassVariableNameKey:'foo::bar' 
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2361
     self keyIsClassVariableNameKey:'foo:bar'  
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2362
     self keyIsClassVariableNameKey:':bar'  
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2363
     self keyIsClassVariableNameKey:'::bar'  
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2364
    "
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2365
!
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  2366
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2367
loadedClassNamed:aString
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2368
    "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
  2369
     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
  2370
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2371
    |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
  2372
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2373
    "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
  2374
     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
  2375
    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
  2376
    sym notNil ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2377
        cls := self at:sym ifAbsent:nil.
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2378
        cls isBehavior ifTrue:[^ cls].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2379
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2380
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2381
    (aString endsWith:' class') ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2382
        nonMeta := self loadedClassNamed:(aString copyWithoutLast:6).
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2383
        nonMeta notNil ifTrue:[
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2384
            ^ nonMeta theMetaclass
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2385
        ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2386
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2387
    ^ nil
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2388
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2389
    "
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2390
     Smalltalk loadedClassNamed:'Object'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2391
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2392
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2393
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2394
     Smalltalk loadedClassNamed:'fooBar' 
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2395
     Smalltalk loadedClassNamed:'true'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2396
     Smalltalk loadedClassNamed:'Object class'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2397
     Smalltalk loadedClassNamed:'Metaclass'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2398
     Smalltalk loadedClassNamed:'Array'    
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2399
     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
  2400
    "
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2401
!
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2402
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2403
methodProtocolCompletion:aPartialProtocolName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2404
    "given a partial method protocol name, return an array consisting of
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2405
     2 entries: 1st: the best (longest) match 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2406
                2nd: collection consisting of matching protocols"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2407
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2408
    ^ DoWhatIMeanSupport methodProtocolCompletion:aPartialProtocolName inEnvironment:self
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2409
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2410
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2411
     Smalltalk methodProtocolCompletion:'doc'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2412
     Smalltalk methodProtocolCompletion:'docu' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2413
     Smalltalk methodProtocolCompletion:'documenta' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2414
    "
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2415
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2416
    "Modified: / 10-08-2006 / 13:05:20 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2417
!
5505
e99e8e9cbfef added #methodProtocolCompletion:
Claus Gittinger <cg@exept.de>
parents: 5504
diff changeset
  2418
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2419
numberOfGlobals
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2420
    "return the number of global variables in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2421
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2422
    |tally "{ Class: SmallInteger }" |
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2423
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2424
    tally := 0.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2425
    self do:[:obj | tally := tally + 1].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2426
    ^ tally
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2427
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2428
    "Smalltalk numberOfGlobals"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2429
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2430
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2431
referencesAny:aCollection
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2432
    "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
  2433
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2434
    self keysAndValuesDo:[:key :val |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2435
        aCollection do:[:anObject |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2436
            (key == anObject) ifTrue:[^ true].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2437
            (val == anObject ) ifTrue:[^ true].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2438
        ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2439
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2440
    ^ super referencesAny:aCollection
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2441
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2442
    "Created: / 2.2.1998 / 16:01:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2443
!
3260
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2444
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2445
referencesDerivedInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2446
    "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
  2447
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2448
    self keysAndValuesDo:[:key :val |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2449
        (key isKindOf:aClass) ifTrue:[^ true].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2450
        (val isKindOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2451
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2452
    ^ super referencesDerivedInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2453
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2454
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2455
referencesInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2456
    "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
  2457
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2458
    self keysAndValuesDo:[:key :val |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2459
        (key isMemberOf:aClass) ifTrue:[^ true].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2460
        (val isMemberOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2461
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2462
    ^ super referencesInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2463
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2464
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2465
referencesObject:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2466
    "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
  2467
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2468
    self keysAndValuesDo:[:key :val |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2469
        (key == anObject) ifTrue:[^ true].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2470
        (val == anObject ) ifTrue:[^ true].
6074
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2471
    ].
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2472
    ^ super referencesObject:anObject
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2473
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2474
    "Modified: / 3.2.1998 / 14:22:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2475
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2476
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2477
resolveName:nameIn inClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2478
    "resolve aName as if compiled within aClass;
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2479
     i.e. if it has a private class with this name, return it;
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2480
     if aName is known within the classes namespace, return that.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2481
     Otherwise, return a global with that name.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2482
     This should be used whereever Smalltalk>>at: used to be used,
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2483
     to resolve a global by name."
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2484
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2485
    |aName sym cls ns|
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2486
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2487
    nameIn isNil ifTrue:[^ nil].
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2488
    nameIn isBehavior ifTrue:[^ nameIn].       "/ already resolved
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2489
    aName := nameIn.
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2490
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2491
    (aName startsWith:'Smalltalk::') ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2492
        aName := aName copyFrom:12.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2493
        ^ self at:(aName asSymbol) ifAbsent:nil.
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2494
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2495
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2496
    sym := aName asSymbol.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2497
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2498
    cls := aClass privateClassesAt:sym.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2499
    cls notNil ifTrue:[^ cls].
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2500
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2501
    ns := aClass nameSpace.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2502
    (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2503
        ns isNameSpace ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2504
            cls := ns at:sym ifAbsent:nil.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2505
        ] ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2506
            cls := ns privateClassesAt:sym
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2507
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  2508
        cls notNil ifTrue:[^ cls].
3025
53b114d5be3e added #resolveClassNamed:
ca
parents: 3022
diff changeset
  2509
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2510
    ^ self at:sym ifAbsent:nil.
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2511
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2512
    "Modified: / 9.7.1999 / 01:18:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2513
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2514
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2515
selectorCompletion:aPartialSymbolName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2516
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2517
     2 entries: 1st: the longest match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2518
                2nd: collection consisting of matching implemented selectors"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2519
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2520
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2521
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2522
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2523
selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2524
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2525
     2 entries: 1st: the longest match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2526
                2nd: collection consisting of matching implemented selectors"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2527
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2528
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2529
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2530
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2531
     Smalltalk selectorCompletion:'at:p'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2532
     Smalltalk selectorCompletion:'nextP' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2533
     Smalltalk selectorCompletion:'nextp' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2534
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2535
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2536
    "Modified: / 7.6.1996 / 08:44:33 / stefan"
3565
966a108e3765 also do caseless selectorCompletion
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
  2537
    "Modified: / 14.6.1998 / 15:54:03 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2538
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2539
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2540
!Smalltalk class methodsFor:'queries-system'!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2541
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2542
dialectName
8736
e6e8a6754506 #dialectName answers a symbol
Stefan Vogel <sv@exept.de>
parents: 8712
diff changeset
  2543
    ^ #SmalltalkX
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2544
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2545
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2546
     Smalltalk dialectName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2547
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2548
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2549
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2550
dialectReleaseVersion
7348
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2551
    ^ self versionString
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2552
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2553
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2554
     Smalltalk dialectReleaseVersion
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2555
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2556
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2557
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2558
isDolphinSmalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2559
    "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
  2560
     applications - add #isDolphinSmalltalk to your dolphin,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2561
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2562
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2563
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2564
!
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2565
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2566
isSmalltalkMT
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2567
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2568
     applications - add #isSmalltalkMT to your smalltalk-MT,
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2569
     returning true there."
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2570
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2571
    ^ false
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2572
!
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2573
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2574
isSmalltalkV
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2575
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2576
     applications - add #isSmalltalkV to your smalltalkV,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2577
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2578
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2579
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2580
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2581
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2582
isSmalltalkX
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2583
    "return true here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2584
     applications - add #isSmalltalkX to your other smalltalks,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2585
     returning false there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2586
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2587
    ^ true
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2588
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2589
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2590
isSqueak
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2591
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2592
     applications - add #isSqueak to your squeak,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2593
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2594
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2595
    ^ false
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2596
!
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2597
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2598
isVisualAge
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2599
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2600
     applications - add #isVisualAge to your visualAge,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2601
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2602
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2603
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2604
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2605
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2606
isVisualWorks
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2607
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2608
     applications - add #isVisualWorks to your visualWorks,
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2609
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2610
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2611
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2612
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2613
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2614
!Smalltalk class methodsFor:'startup'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2615
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2616
browserWindowStartup
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2617
    |windowIDString numericWindowID windowID params idx process|
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2618
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2619
    idx := CommandLineArguments indexOf:'--browserWindow:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2620
    windowIDString := CommandLineArguments at:idx+1.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2621
    numericWindowID := Integer fromString:windowIDString.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2622
    windowID := ExternalAddress newAddress:numericWindowID.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2623
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2624
    idx := CommandLineArguments indexOf:'--browserParameters:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2625
    idx ~~ 0 ifTrue:[
9047
7bd12cc7b471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9043
diff changeset
  2626
        params := Dictionary new.
7bd12cc7b471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9043
diff changeset
  2627
        (CommandLineArguments copyFrom:idx+1) pairWiseDo:[:key :value |
7bd12cc7b471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9043
diff changeset
  2628
            params at:key put:value.
7bd12cc7b471 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9043
diff changeset
  2629
        ].
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2630
    ].
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2631
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2632
    'browserWindow is: ' errorPrint. windowID errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2633
    'browserParameters are: ' errorPrint. params errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2634
    'Display is: ' errorPrint. Display errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2635
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2636
    process := [
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2637
        PluginSupport
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2638
            startInBrowserWithWindowID:windowID 
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2639
            parameters:params.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2640
    ] newProcess.
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2641
    process priority:(Processor userSchedulingPriority).
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2642
    process name:'browser start handler'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2643
    process beGroupLeader.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2644
    process resume.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2645
    process := nil.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2646
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2647
    Processor dispatchLoop.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2648
    Smalltalk exit.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2649
!
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2650
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2651
displayInitializationDone
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2652
    "inform the restart, that the display has been initialized"
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2653
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2654
    CallbackSignal raiseRequest.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2655
!
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2656
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2657
mainStartup:graphicalMode
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2658
    "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
  2659
     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
  2660
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2661
    |process imageName thisIsARestart idx|
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2662
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2663
    imageName := ObjectMemory imageName.
2249
cdb6c87f0707 send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
  2664
    thisIsARestart := imageName notNil.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2665
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2666
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2667
     if there is a display, start its event dispatcher 
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2668
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2669
    Display notNil ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2670
        Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2671
            SaveEmergencyImage == true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2672
                'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2673
                ObjectMemory primSnapShotOn:'crash.img'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2674
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2675
            'Display [warning]: broken display connection - exit.' infoPrintCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2676
            self exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2677
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2678
        Display startDispatch.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2679
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2680
9016
2979527dbdf4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  2681
    idx := CommandLineArguments indexOf:'--browserWindow:'.
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2682
    IsPlugin := (idx ~~ 0).
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2683
    IsPlugin ifTrue:[
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  2684
        self browserWindowStartup.
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
  2685
        "/ not reached
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2686
    ].
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2687
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2688
    Initializing := false.
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2689
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2690
    "/ 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
  2691
    "/ 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
  2692
    "/ 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
  2693
    "/ 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
  2694
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2695
    process := [
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2696
        StartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2697
            StartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2698
                aBlock value
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2699
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2700
            StartBlocks := nil.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2701
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2702
        ImageStartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2703
            ImageStartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2704
                aBlock value
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2705
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2706
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2707
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2708
            (SilentLoading == true) ifFalse:[   "i.e. undefined counts as false" 
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2709
                thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2710
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2711
                    Transcript showCR:('Smalltalk restarted from:'
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2712
                                        , imageName
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2713
                                        , ' (saved '
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2714
                                        , ObjectMemory imageSaveTime printString
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2715
                                        , ')' ).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2716
                ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2717
                    Transcript showCR:(self hello).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2718
                    Transcript showCR:(self copyrightString).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2719
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2720
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2721
                Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2722
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2723
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2724
            DemoMode==true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2725
                Transcript showCR:'*** Restricted use:                              ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2726
                Transcript showCR:'*** This program may be used for education only. ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2727
                Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE  ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2728
                Transcript showCR:'*** for more details.                            ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2729
                Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2730
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2731
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2732
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2733
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2734
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2735
            "/ the final late notification - users can now assume that
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2736
            "/ views, forms etc. have been recreated.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2737
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2738
            ObjectMemory changed:#returnFromSnapshot.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2739
        ]
7039
6f1c02381145 Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents: 7000
diff changeset
  2740
7040
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2741
    ] newProcess.
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2742
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2743
    process priority:(Processor userSchedulingPriority).
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2744
    process name:'start block handler'.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2745
    process beGroupLeader.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2746
    process resume.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2747
    process := nil.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2748
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2749
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2750
    "/ 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
  2751
    "/ message.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2752
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2753
    (StartupClass notNil and:[StartupSelector notNil]) ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2754
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2755
         allow more customization by reading an image specific rc-file
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2756
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2757
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2758
            (imageName asFilename hasSuffix:'img') ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2759
                imageName := imageName copyWithoutLast:4
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2760
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2761
            self fileIn:(imageName , '.rc')
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2762
        ].
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2763
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2764
"/        Display notNil ifTrue:[
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2765
"/            Display exitOnLastClose:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2766
"/        ].
2086
4a9d8b5cada7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
  2767
"/        Processor exitWhenNoMoreUserProcesses:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2768
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2769
        process := [
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2770
            StandAlone ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2771
                AbortOperationRequest handle:[:ex |
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2772
                    'Smalltalk [info]: aborted - exit.' infoPrintCR.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2773
                    OperatingSystem exit:1
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2774
                ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2775
                    StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2776
                ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2777
            ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2778
                StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2779
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2780
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2781
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2782
            "/ non-GUI apps exit after the startup;
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2783
            "/ assume that GUI apps have created & opened some view ...
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2784
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2785
            Display isNil ifTrue:[
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2786
                'Smalltalk [info]: no Display - exit.' infoPrintCR.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2787
                Smalltalk exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2788
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2789
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2790
            "/ GUI apps exit after the last user process has finished
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2791
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2792
            Display exitOnLastClose:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2793
            Processor exitWhenNoMoreUserProcesses:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2794
        ] newProcess.
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2795
        process priority:(Processor userSchedulingPriority).
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2796
        process name:'main'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2797
        process beGroupLeader.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2798
        process resume.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2799
        process := true.    "do not refer to process"
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2800
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2801
9201
c1e6d3ebaac5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9200
diff changeset
  2802
    StandAlone ifTrue:[
9202
9ddc3b29bcf9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9201
diff changeset
  2803
        Display notNil ifTrue:[
9ddc3b29bcf9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9201
diff changeset
  2804
            FlyByHelp notNil ifTrue:[
9ddc3b29bcf9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9201
diff changeset
  2805
                FlyByHelp start
9ddc3b29bcf9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9201
diff changeset
  2806
            ].
9201
c1e6d3ebaac5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9200
diff changeset
  2807
        ].
c1e6d3ebaac5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9200
diff changeset
  2808
    ].
c1e6d3ebaac5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9200
diff changeset
  2809
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2810
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2811
     if view-classes exist, start dispatching;
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2812
     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
  2813
    "
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  2814
    ((Display notNil and:[graphicalMode]) 
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2815
     or:[process notNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2816
     or:[HeadlessOperation]]) ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2817
        Processor dispatchLoop.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2818
    ] ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2819
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2820
            self readEvalPrint
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2821
        ]
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2822
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2823
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2824
    "done - the last process finished"
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2825
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2826
    'Smalltalk [info]: last process finished - exit.' infoPrintCR.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2827
    self exit
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2828
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2829
    "Created: / 18.7.1996 / 21:07:39 / cg"
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2830
    "Modified: / 9.9.1996 / 17:42:50 / stefan"
3483
029aabc7f3c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3475
diff changeset
  2831
    "Modified: / 25.5.1998 / 15:02:57 / cg"
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2832
!
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2833
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2834
readEvalPrint
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2835
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2836
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2837
    "simple read-eval-print loop for non-graphical Minitalk"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2838
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2839
    |text|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2840
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2841
    'ST- ' print.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2842
    Stdin skipSeparators.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2843
    Stdin atEnd ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2844
        text := Stdin nextChunk.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2845
        [text notNil] whileTrue:[
8675
ceef81bb2d0c AbortOperationRequest is now a subclass (and child-Exception) of.
Stefan Vogel <sv@exept.de>
parents: 8665
diff changeset
  2846
            AbortAllOperationRequest handle:[:ex |
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2847
                'evaluation aborted' printCR
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2848
            ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2849
                Compiler isNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2850
                    'No evaluator class available (Compiler == nil)' printCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2851
                    ^ self
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2852
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2853
                (Compiler evaluate:text) printCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2854
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2855
            'ST- ' print.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2856
            text := Stdin nextChunk
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2857
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2858
    ].
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  2859
    '' printCR
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2860
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2861
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2862
restart
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2863
    "startup after an image has been loaded;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2864
     there are three change-notifications made to dependents of ObjectMemory,
10
claus
parents: 8
diff changeset
  2865
     which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
335
claus
parents: 329
diff changeset
  2866
3096
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2867
     #earlySystemInstallation is sent for ST80 compatibility
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2868
10
claus
parents: 8
diff changeset
  2869
     #earlyRestart is send first, nothing has been setup yet.
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2870
                   (should be used to flush all device dependent entries)
335
claus
parents: 329
diff changeset
  2871
10
claus
parents: 8
diff changeset
  2872
     #restarted is send right after.
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2873
                   (should be used to recreate external resources (fds, bitmaps etc)
335
claus
parents: 329
diff changeset
  2874
10
claus
parents: 8
diff changeset
  2875
     #returnFromSnapshot is sent last
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2876
                   (should be used to restart processes, reOpen Streams which cannot
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2877
                    be automatically be reopened (i.e. Sockets, Pipes) and so on.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2878
                   (Notice that positionable fileStreams are already reopened and repositioned)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2879
     "
10
claus
parents: 8
diff changeset
  2880
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2881
    |deb insp transcript idx|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2882
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2883
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2884
    "/ when we arrive here, all objects from our previous life
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2885
    "/ have been reloaded - however, some may still contain invalid device
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2886
    "/ handles, display information etc.
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2887
    "/ also, dynamically loaded modules have not yet been reloaded yet.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2888
    "/ and the concrete OS, concrete FileName etc. are still refering to
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2889
    "/ the previous classes.
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2890
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2891
    Initializing := true.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2892
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2893
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2894
    ImageRestartTime := Timestamp now.
335
claus
parents: 329
diff changeset
  2895
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2896
    CommandLine := CommandLineArguments copy.
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2897
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
  2898
    CommandName := CommandLineArguments removeFirst. "/ the command
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2899
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2900
    idx := CommandLineArguments indexOf:'-q'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2901
    idx == 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2902
        idx := CommandLineArguments indexOf:'--silent'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2903
    ].
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2904
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2905
        Object infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2906
        ObjectMemory infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2907
        CommandLineArguments removeAtIndex:idx.
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2908
    ].
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2909
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2910
    "/
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2911
    "/ start catching SIGSEGV and SIGBUS
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2912
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2913
    OperatingSystem enableHardSignalInterrupts.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2914
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2915
    "/ reinit Filename
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2916
    Filename reinitialize.
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2917
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2918
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2919
    "/ flush cached path directories (may have changed in the meanwhile)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2920
329
claus
parents: 326
diff changeset
  2921
    self flushPathCaches.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2922
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2923
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2924
    "/ reinit the default streams: Stdin, Stdout and Stderr
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2925
    "/ after that, we can write to stderr.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2926
477
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2927
    self reinitStandardStreams.
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2928
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2929
    "/
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2930
    "/ redirect Transcript to Stderr during startup    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2931
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2932
    transcript := Transcript.    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2933
    Transcript := Stderr.
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2934
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2935
    "/
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2936
    "/ temporary switch back to dumb interface - 
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2937
    "/ to handle errors while view-stuff is not yet reinitialized
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2938
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2939
    insp := Inspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2940
    deb := Debugger.
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2941
    deb notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2942
        deb reinitialize
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2943
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2944
    Inspector := MiniInspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2945
    Debugger := MiniDebugger.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2946
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2947
    "/ reload any dynamically loaded objects.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2948
    "/ this must be done before doing anything else below,
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2949
    "/ because the Processor may restart processes which use
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2950
    "/ this code.
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2951
    "/ Also, a dynamic object might be registered as dependent of
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2952
    "/ ObjectFileLoader; therefore, must reload before doing any notifications.
335
claus
parents: 329
diff changeset
  2953
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2954
    ObjectFileLoader notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2955
        ObjectFileLoader reloadAllRememberedObjectFiles.
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2956
    ].
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2957
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2958
    "/
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2959
    "/ invalidate all display connections.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2960
    "/ This is required to avoid trouble if someone accesses
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2961
    "/ a display during early startup.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2962
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2963
    Screen notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2964
        Screen allScreens do:[:aDisplay |
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2965
            aDisplay invalidateConnection
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2966
        ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2967
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2968
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2969
    ObjectMemory changed:#earlySystemInstallation.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2970
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2971
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2972
    "/ reinitialize the Processor - restartable processes
4109
3e536657cff6 comment only
Claus Gittinger <cg@exept.de>
parents: 4099
diff changeset
  2973
    "/ are now restarted here (but not yet scheduled).
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2974
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2975
    Processor reinitialize.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2976
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2977
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2978
    "/ flush device handles & recreate OS resources (if possible)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2979
    "/ (mostly view/GC/color & font stuff)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2980
3022
1b6800d56d62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3021
diff changeset
  2981
    ObjectMemory
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2982
        changed:#earlyRestart; changed:#restarted.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2983
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2984
    "/
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2985
    "/ start catching SIGINT and SIGQUIT
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2986
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2987
    OperatingSystem enableUserInterrupts.
6390
41d5c47c33f0 Catch sigPWR and sigHUP on restart
Stefan Vogel <sv@exept.de>
parents: 6366
diff changeset
  2988
    OperatingSystem enableCrashSignalInterrupts.
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2989
8958
6cb2a9cd649c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8957
diff changeset
  2990
    "/ give user a chance to re-customize things in smalltalk_r.rc.
8957
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2991
    "/ reading if smalltalk_r.rc may be suppressed by the --faststart argument.
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2992
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2993
    idx := CommandLineArguments indexOf:'--faststart'.
8957
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2994
    idx == 0 ifTrue:[
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2995
        idx := CommandLineArguments indexOf:'--fastStart'.
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2996
    ].
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2997
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2998
        CommandLineArguments removeAtIndex:idx.
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2999
    ] ifFalse:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3000
        CallbackSignal := QuerySignal new.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3001
        [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3002
            Class withoutUpdatingChangesDo:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3003
                (self fileIn:(self commandName , '_r.rc')) ifFalse:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3004
                    "no _r.rc file where executable is; try default smalltalk_r.rc"
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3005
                    self fileIn:'smalltalk_r.rc'
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3006
                ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3007
            ]
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3008
        ] on:CallbackSignal do:[:ex|
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3009
            "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3010
            "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3011
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3012
            Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3013
            Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3014
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3015
            "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3016
            "/ if there was no Transcript, go to stderr
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3017
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3018
            (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3019
                Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3020
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3021
            Initializing := false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3022
            ex proceed.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3023
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3024
        CallbackSignal := nil.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3025
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3026
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3027
    "/ reinitialization (restart) of Display is normally performed
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3028
    "/ in the restart script. If this has not been run for some reason,
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3029
    "/ do in now.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3030
    Initializing ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3031
        Display notNil ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3032
            [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3033
                Display reinitializeFor:Screen defaultDisplayName.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3034
            ] on:Screen deviceOpenErrorSignal do:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3035
                'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3036
                Screen defaultDisplayName errorPrintCR.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3037
                OperatingSystem exit:1.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3038
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3039
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3040
        "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3041
        "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3042
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3043
        Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3044
        Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3045
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3046
        "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3047
        "/ if there was no Transcript, go to stderr
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3048
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3049
        (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3050
            Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3051
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  3052
        Initializing := false.
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  3053
    ].
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3054
    Screen notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3055
        "clean up leftover screens (and views) that haven't been reopened.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3056
         Operate on a copy, since brokenConnection removes us from AllScreens"
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3057
        Screen allScreens copy do:[:eachDisplay |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3058
            eachDisplay isOpen ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3059
                'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3060
                eachDisplay errorPrintCR.
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  3061
                eachDisplay cleanupAfterDispatch; brokenConnection.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3062
            ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3063
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  3064
    ].
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  3065
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  3066
    deb := insp := transcript := nil.   "avoid dangling refs"   
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3067
    self mainStartup:true
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3068
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  3069
    "Modified: / 7.6.1998 / 02:48:00 / cg"
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  3070
    "Modified: / 3.8.1999 / 09:42:21 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3071
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3072
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3073
start
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3074
    "main startup, if there is a Display, initialize it
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3075
     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
  3076
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  3077
    |idx graphicalMode arg didReadRCFile|
960
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  3078
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  3079
    graphicalMode := true.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3080
    Initializing := true.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3081
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3082
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3083
     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
  3084
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3085
    Class withoutUpdatingChangesDo:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3086
        |myName defaultRC prevCatchSetting|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3087
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3088
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3089
        "/ look for any '-q', '-e' or '-f' command line arguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3090
        "/ and handle them;
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3091
        "/ read startup and patches file
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3092
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3093
        idx := CommandLineArguments indexOf:'-q'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3094
        idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3095
            idx := CommandLineArguments indexOf:'--silent'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3096
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3097
        idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3098
            Object infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3099
            ObjectMemory infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3100
            CommandLineArguments removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3101
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3102
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3103
        StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3104
            "/ look for a '-e filename' or '--execute filename' argument 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3105
            "/ this will force fileIn of filename only, no standard startup.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3106
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3107
            idx := CommandLineArguments indexOf:'-e'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3108
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3109
                idx := CommandLineArguments indexOf:'--execute'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3110
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3111
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3112
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3113
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3114
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3115
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3116
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3117
                arg = '-' ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3118
                    self fileInStream:Stdin
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3119
                           lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3120
                           silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3121
                           logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3122
                           addPath:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3123
                ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3124
                    self fileIn:arg.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3125
                ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3126
                self exit
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3127
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3128
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3129
            "/ look for a '-E expr' or '--eval expr' argument 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3130
            "/ this will force evaluation of expr only, no standard startup
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3131
            idx := CommandLineArguments indexOf:'-E'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3132
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3133
                idx := CommandLineArguments indexOf:'--eval'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3134
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3135
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3136
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3137
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3138
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3139
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3140
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3141
                self 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3142
                    fileInStream:arg readStream
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3143
                    lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3144
                    silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3145
                    logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3146
                    addPath:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3147
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3148
                self exit
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3149
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3150
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3151
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3152
        "look for a '-f filename' or '--file filename' argument 
9205
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3153
         this will force evaluation of filename instead of smalltalk.rc"
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3154
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3155
"/        "If there is only one argument, which does not start with a '-',
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3156
"/         this is the same as -f filename"
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3157
"/        (CommandLineArguments size == 1 
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3158
"/         and:[(CommandLineArguments first startsWith:$-) not]) ifTrue:[
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3159
"/            myName := CommandLineArguments removeFirst.
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3160
"/        ].
ed574f5cfbd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9204
diff changeset
  3161
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3162
        myName isNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3163
            idx := CommandLineArguments indexOf:'-f'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3164
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3165
                idx := CommandLineArguments indexOf:'--file'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3166
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3167
            idx ~~ 0 ifTrue:[
9251
e413a9a575c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9239
diff changeset
  3168
                myName := CommandLineArguments at:idx+1.
e413a9a575c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9239
diff changeset
  3169
                CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3170
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3171
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3172
        myName notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3173
            CommandName := myName.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3174
            (self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3175
                ('Smalltalk [error]: startup file ', myName, ' not found.') errorPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3176
                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3177
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3178
        ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3179
            "/ look for <command>.rc
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3180
            "/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3181
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3182
            didReadRCFile := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3183
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3184
            myName := self commandName asFilename withSuffix:'rc'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3185
            (didReadRCFile := self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3186
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3187
                    defaultRC := 'smalltalk.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3188
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3189
                    defaultRC := 'stxapp.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3190
                ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3191
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3192
                didReadRCFile := self secureFileIn:defaultRC.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3193
                didReadRCFile ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3194
                    StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3195
                        'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3196
                        graphicalMode := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3197
                    ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3198
                ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3199
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3200
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3201
            "/ ('StandAlone is %1' bindWith:StandAlone) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3202
            "/ ('Headless is %1' bindWith:HeadlessOperation) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3203
            "/ ('Display is %1' bindWith:Display) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3204
            "/ ('Screen is %1' bindWith:Screen) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3205
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3206
            didReadRCFile ifFalse:[
9211
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3207
                "/
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3208
                "/ No RC file found;
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3209
                "/ Setup more default stuff
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3210
                "/
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3211
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3212
                    "/ its a smalltalk - proceed in interpreter.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3213
                    'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3214
                    graphicalMode := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3215
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3216
                    "/ its an application - try harder
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3217
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3218
                    Screen notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3219
                        [
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3220
                            Screen openDefaultDisplay:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3221
                        ] on:Screen deviceOpenErrorSignal do:[:ex|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3222
                            ('Smalltalk [error]: No Display connection to: ', ex parameter printString) errorPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3223
                            'Smalltalk [info]: Either set the DISPLAY environment variable,' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3224
                            'Smalltalk [info]: or start smalltalk with a -display argument.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3225
                            HeadlessOperation == true ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3226
                                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3227
                            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3228
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3229
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3230
                        Display notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3231
                            (self secureFileIn:'display.rc') ifFalse:[
9252
fb5b1a8f8414 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9251
diff changeset
  3232
                                "/ 'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' errorPrintCR.
9211
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3233
                                (self secureFileIn:'keyboard.rc') ifFalse:[
9252
fb5b1a8f8414 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9251
diff changeset
  3234
                                    "/ 'Smalltalk [warning]: no keyboard.rc found; shortkey setting might be wrong.' errorPrintCR.
9211
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3235
                                ]
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3236
                            ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3237
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3238
                    ]
9211
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3239
                ].
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3240
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3241
                "/ setup more defaults...
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3242
                ObjectMemory startBackgroundCollectorAt:5.
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3243
                ObjectMemory startBackgroundFinalizationAt:5.
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3244
                self addStartBlock:[
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3245
                    Processor startTimeSlicing.
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3246
                    Processor supportDynamicPriorities:true.
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3247
                    ObjectMemory backgroundCollectProcess priorityRange:(4 to:9).
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3248
                    ObjectMemory backgroundFinalizationProcess priorityRange:(4 to:9).
4e77c4fcdae0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9205
diff changeset
  3249
                ].
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3250
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3251
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3252
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3253
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
  3254
    StandAlone ifFalse:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3255
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3256
         enable the graphical debugger/inspector 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3257
         (they could have been (re)defined as autoloaded in the patches file)
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3258
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3259
        self initStandardTools.
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
  3260
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3261
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3262
    (Display isNil or:[HeadlessOperation]) ifTrue:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3263
        graphicalMode := false.
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3264
    ].
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3265
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3266
    self mainStartup:graphicalMode
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3267
5146
bfe5096a2d06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5145
diff changeset
  3268
    "Modified: / 24.12.1999 / 00:26:54 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3269
! !
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3270
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3271
!Smalltalk class methodsFor:'startup queries'!
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3272
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3273
commandLine
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3274
    "return the full command line arguments (with which ST/X was started)"
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3275
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3276
    ^ CommandLine
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3277
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3278
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3279
     Smalltalk commandLine   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3280
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3281
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3282
    "Created: 19.7.1996 / 11:09:06 / cg"
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3283
!
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3284
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3285
commandLineArgumentNamed:aString
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3286
    "extract a named argument from the command line arguments."
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3287
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3288
    |args index|
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3289
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3290
    args := self commandLineArguments.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3291
    index := args indexOf:aString.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3292
    (index between:1 and:(args size - 1)) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3293
        ^ args at:index+1
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3294
    ].
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3295
    ^ nil.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3296
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3297
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3298
     self commandLineArgumentNamed:'-display'
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3299
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3300
!
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3301
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3302
commandLineArguments
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3303
    "return the user command line arguments;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3304
     This is a collection of strings (separated command line words),
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3305
     from which the internal startup arguments have already been removed.
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3306
     I.e. if started with: 'smalltalk -I -f xxx foo bar baz',
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3307
     the commandLineArguments will be #('foo' 'bar' 'baz').
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3308
     In contrast, the value returned by #commandLine will be the full set of words."
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3309
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3310
    ^ CommandLineArguments
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3311
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3312
    "Modified: 19.7.1996 / 11:11:03 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3313
!
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3314
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3315
commandName
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3316
    "return the excutables name - this is normally 'stx', 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3317
     but can be something else for standAlone apps."
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3318
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3319
    ^ CommandName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3320
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3321
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3322
     Smalltalk commandName
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3323
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3324
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3325
    "Modified: 19.7.1996 / 11:11:16 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3326
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3327
9054
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3328
hasNoConsole
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3329
    "return true, if this is a console-less application (i.e. I am winstx)
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3330
     i.e. there should be no writing to stdout/stderr"
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3331
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3332
    ^ HasNoConsole ? false
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3333
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3334
    "
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3335
     Smalltalk hasNoConsole   
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3336
    "
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3337
!
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  3338
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3339
isHeadless
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3340
    "return true, if this is a headless application
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3341
     i.e. no default Display connection is required/used"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3342
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3343
    ^ HeadlessOperation ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3344
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3345
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3346
     Smalltalk isHeadless   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3347
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3348
!
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3349
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3350
isPlugin
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3351
    "return true, if this is a plugin application
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3352
     i.e. running in a browserWindow"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3353
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3354
    ^ IsPlugin ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3355
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3356
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3357
     Smalltalk isPlugin   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3358
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3359
!
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  3360
9510
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3361
isSharedLibraryComponent
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3362
    "return true, if this is a shared library component of another application
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3363
     i.e. a dll within another app."
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3364
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3365
    ^ IsSharedLibraryComponent ? false
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3366
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3367
    "
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3368
     Smalltalk isSharedLibraryComponent   
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3369
    "
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3370
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3371
    "Created: / 10-08-2006 / 13:09:34 / cg"
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3372
!
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3373
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3374
isSmalltalkDevelopmentSystem
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3375
    "return true, if this is a real smalltalk system
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3376
     i.e. NOT a stripped & linked application (such as the webServer)
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3377
     and NOT a plugIn (i.e. running in a browser)
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3378
     and NOT a sharedLibrary component (i.e. a dll in another app)."
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3379
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3380
    ^ self isPlugin not
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3381
    and:[ self isSharedLibraryComponent not 
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3382
    and:[ self isStandAloneApp not ]]
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3383
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3384
    "
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3385
     Smalltalk isSmalltalkDevelopmentSystem   
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3386
    "
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3387
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3388
    "Created: / 10-08-2006 / 13:12:49 / cg"
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3389
!
8d31b20d66b3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9508
diff changeset
  3390
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3391
isStandAloneApp
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3392
    "return true, if this is a standAlone application
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3393
     i.e. a stripped & linked application (such as the webServer)
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3394
     in contrast to a full smalltalk (development) system."
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3395
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3396
    ^ StandAlone ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3397
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3398
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3399
     Smalltalk isStandAloneApp   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3400
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3401
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3402
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3403
startupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3404
    "return the arguments passed to StartupClass when stx gets started.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3405
     Usually these are nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3406
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3407
     a simple way to configure and create stand-alone applications"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3408
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3409
    ^ StartupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3410
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3411
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3412
     Smalltalk startupArguments   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3413
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3414
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3415
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3416
startupClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3417
    "return the class, that will get the start message when smalltalk
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3418
     starts and its non-nil. Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3419
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3420
     a simple way to configure and create stand-alone applications"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3421
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3422
    ^ StartupClass
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3423
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3424
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3425
     Smalltalk startupClass   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3426
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3427
!
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  3428
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3429
startupClass:aClass selector:aSymbol arguments:anArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3430
    "{ Pragma: +optSpace }"
1119
956d62a5656c compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
  3431
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3432
    "set the class, selector and arguments to be performed when smalltalk
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3433
     starts. Setting those before saving a snapshot, will make the saved
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3434
     image come up executing your application (instead of the normal mainloop)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3435
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3436
    StartupClass := aClass.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3437
    StartupSelector := aSymbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3438
    StartupArguments := anArrayOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3439
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3440
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3441
startupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3442
    "return the selector, that will be sent to StartupClass.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3443
     Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3444
     but saving an image with a non-nil StartupClass/StartupSelector allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3445
     a simple way to configure and create stand-alone applications"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3446
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3447
    ^ StartupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3448
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3449
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3450
     Smalltalk startupSelector   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3451
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3452
!
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3453
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3454
wasStartedFromImage
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3455
    "return true, if this smalltalk was started from an image, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3456
     as opposed to a fresh and clean startup"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3457
7819
9908e6e36175 wasStartedFromImage fixed
ca
parents: 7811
diff changeset
  3458
    ^ ImageRestartTime notNil
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3459
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3460
    "
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3461
     Smalltalk wasStartedFromImage
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3462
    "
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3463
! !
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3464
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3465
!Smalltalk class methodsFor:'system environment'!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3466
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3467
language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3468
    "return the language setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3469
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3470
    ^ Language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3471
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3472
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3473
     Smalltalk language
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3474
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3475
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3476
    "Modified: 26.4.1996 / 17:10:05 / cg"
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3477
!
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3478
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3479
language:aLanguageSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3480
    "set the language"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3481
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3482
    Language := aLanguageSymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3483
    self changed:#Language
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3484
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3485
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3486
     Smalltalk language:#de
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3487
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3488
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3489
    "Modified: 26.4.1996 / 17:13:34 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3490
!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3491
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3492
languageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3493
    "return the language territory setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3494
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3495
    ^ LanguageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3496
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3497
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3498
languageTerritory:aTerritorySymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3499
    "set the language territory"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3500
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3501
    LanguageTerritory := aTerritorySymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3502
    self changed:#LanguageTerritory
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3503
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3504
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3505
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3506
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3507
     Smalltalk languageTerritory:#us.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3508
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3509
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3510
     Smalltalk languageTerritory:#de.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3511
     Time now    
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3512
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3513
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3514
    "Modified: 26.4.1996 / 17:12:39 / cg"
7992
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3515
!
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3516
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3517
setLanguage:aLanguageSymbol
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3518
    "set the language withotu change notifications"
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3519
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3520
    Language := aLanguageSymbol.
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3521
! !
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3522
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3523
!Smalltalk class methodsFor:'system management'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3524
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3525
compressSources
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3526
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3527
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3528
    "compress the sources file, and remove all method source strings
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3529
     from the system and replace them by refs to a string in the source file.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3530
     This is a bit different in ST/X than in other smalltalks,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3531
     since we use per-class sourcefiles for the compiled classes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3532
     and a mix of in-memory strings and one-for-all sourceFile for
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3533
     incremental compiled methods.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3534
     Therefore, only those sources which are not coming from compiled
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3535
     methods are put into the 'st.src' file - all others are untouched.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3536
     This is being automated - so dont care for now."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3537
7105
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3538
    |newStream table source pos fileName|
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3539
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3540
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3541
     first, find all methods which contain either a string-ref
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3542
     or an external string in the 'st.src' file
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3543
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3544
    newStream := 'src.tmp' asFilename writeStream.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3545
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3546
    table := IdentityDictionary new:100.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3547
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3548
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3549
        source := nil.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3550
        aMethod sourcePosition notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3551
            aMethod sourceFilename = 'st.src' ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3552
                source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3553
            ]
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3554
        ] ifFalse:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3555
            source := aMethod source
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3556
        ].
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3557
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3558
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3559
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3560
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3561
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3562
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3563
             dont change the methods info - maybe some write error
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3564
             occurs later, in that case we abort and leave everything
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3565
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3566
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3567
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3568
        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3569
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3570
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3571
    newStream close.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3572
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3573
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3574
     now, rename the new source file,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3575
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3576
    fileName := (ObjectMemory nameForSources).
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3577
    'src.tmp' asFilename renameTo:fileName.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3578
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3579
    "good - now go over all changed methods, and change their
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3580
     source reference"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3581
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3582
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3583
        aMethod localSourceFilename:fileName position:pos.
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  3584
"/        aMethod printCR.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3585
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3586
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3587
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3588
     Smalltalk compressSources
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3589
    "
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3590
2176
1a24b0cef25a when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  3591
    "Modified: 16.1.1997 / 01:25:58 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3592
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3593
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3594
generateSingleSourceFile
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3595
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3596
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3597
    "generate the sources file, and remove all method source strings
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3598
     from the system and replace them by refs to a string in the source file.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3599
     This makes the image independent from the per-class source files
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3600
     and makes transportation of endUser applications easier, since
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3601
     only 3 files (executable, image and sourceFile) need to be 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3602
     transported."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3603
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3604
    |newStream table source pos fileName|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3605
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3606
    newStream := 'src.tmp' asFilename writeStream.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3607
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3608
    table := IdentityDictionary new:100.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3609
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3610
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3611
        source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3612
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3613
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3614
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3615
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3616
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3617
             dont change the methods info - maybe some write error
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3618
             occurs later, in that case we abort and leave everything
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3619
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3620
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3621
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3622
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3623
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3624
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3625
    newStream close.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3626
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3627
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3628
     now, rename the new source file,
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3629
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3630
    fileName := (ObjectMemory nameForSources).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3631
    'src.tmp' asFilename renameTo:fileName.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3632
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3633
    "good - now go over all changed methods, and change their
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3634
     source reference"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3635
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3636
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3637
        aMethod localSourceFilename:fileName position:pos.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3638
"/        aMethod printCR.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3639
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3640
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3641
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3642
     Smalltalk generateSingleSourceFile
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3643
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3644
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3645
    "Modified: 16.1.1997 / 01:25:58 / cg"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3646
    "Created: 17.10.1997 / 13:00:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3647
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3648
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3649
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3650
    "create & install an autoload stub for a class named: clsName,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3651
     to be loaded from package.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3652
     If revisionOrNil is non-nil, set it up to load exactly that revision
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3653
     (otherwise, the newest revision will be loaded"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3654
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3655
    ^ self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3656
        installAutoloadedClassNamed:clsName
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3657
        category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3658
        package:package
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3659
        revision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3660
        numClassInstVars:nil.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3661
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3662
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3663
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3664
    "create & install an autoload stub for a class named: clsName,
3915
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3665
     to be loaded from package.
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3666
     If revisionOrNil is non-nil, set it up to load exactly that revision
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3667
     (otherwise, the newest revision will be loaded"
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3668
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3669
    |clsSym cls|
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3670
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3671
    clsSym := clsName asSymbol.
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3672
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3673
    "/ install if not already compiled-in
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3674
    (cls := self at:clsSym) isNil ifTrue:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3675
        Autoload subclass:clsSym
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3676
            instanceVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3677
            classVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3678
            poolDictionaries:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3679
            category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3680
            inEnvironment:Smalltalk.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3681
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3682
        cls := self at:clsSym.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3683
        cls isNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3684
            ('Smalltalk [warning]: failed to install ' , clsName , ' as autoloaded.') infoPrintCR.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3685
        ] ifFalse:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3686
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3687
            revisionOrNil notNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3688
                cls setBinaryRevision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3689
            ]
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3690
        ]    
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3691
    ] ifFalse:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3692
        "/ class already present - however, check for category/package change
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3693
        package ~= cls package ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3694
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3695
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3696
        cat ~= cls category ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3697
            cls category:cat.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3698
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3699
    ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3700
    ^ cls.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3701
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3702
    "Created: / 5.11.1998 / 15:10:25 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3703
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3704
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3705
installAutoloadedClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3706
    "read the standard abbreviation file; install all classes found there as
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3707
     autoloaded. This takes some time ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3708
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3709
    |dirsConsulted p|
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3710
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3711
    "/ new scheme: look for a directory called 'packages'
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3712
    "/ and enumerate its abbrev.stc files...
5067
335c866e150c walk packagePath when reading abbrevs & autoloaded classes.
Claus Gittinger <cg@exept.de>
parents: 5065
diff changeset
  3713
    dirsConsulted := Set new.
5162
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3714
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3715
    "/ along the package-path
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3716
    (p := self packagePath) do:[:aPath |
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3717
        (dirsConsulted includes:aPath) ifFalse:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3718
            ('Smalltalk [info]: installing autoloaded classes found under ''' , aPath ,'''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3719
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3720
                recursiveInstallAutoloadedClassesFrom:aPath 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3721
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3722
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3723
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3724
                packageTop:aPath.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3725
        ]
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3726
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3727
    p size == 0 ifTrue:[
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3728
        '../../../stx' asFilename exists ifTrue:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3729
            ('Smalltalk [info]: installing autoloaded classes found under ''../../..''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3730
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3731
                recursiveInstallAutoloadedClassesFrom:'../../..' 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3732
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3733
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3734
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3735
                packageTop:'../../..'.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3736
        ].
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3737
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3738
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3739
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3740
     Smalltalk installAutoloadedClasses
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3741
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3742
5096
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3743
    "Created: / 14.2.1997 / 17:32:57 / cg"
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3744
    "Modified: / 13.12.1999 / 11:56:50 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3745
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3746
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3747
installAutoloadedClassesFrom:anAbbrevFilePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3748
    "read the given abbreviation file; install all classes found there as
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3749
     autoloaded. This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3750
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3751
    |f s|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3752
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3753
    f := self getSystemFileName:anAbbrevFilePath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3754
    f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3755
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3756
    f notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3757
        f := f asFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3758
        f isDirectory ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3759
            f := f construct:'abbrev.stc'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3760
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3761
        [
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3762
            s := f readStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3763
            self installAutoloadedClassesFromStream:s.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3764
            s close.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3765
        ] on:FileStream openErrorSignal do:[:ex| "do nothing"].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3766
    ]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3767
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3768
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3769
     Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3770
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3771
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3772
    "Modified: / 5.11.1998 / 15:10:51 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3773
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3774
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3775
installAutoloadedClassesFromStream:anAbbrevFileStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3776
    "read the given abbreviation file; 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3777
     install all classes found there as autoloaded, and also update the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3778
     abbreviation (className-to-fileName mapping) table.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3779
     This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3780
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3781
    |s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w|
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3782
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3783
    anAbbrevFileStream isFileStream ifTrue:[
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3784
        abbrevFileName := anAbbrevFileStream pathName.
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3785
        info := 'declared from: ', abbrevFileName.
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3786
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3787
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3788
    KnownPackages isNil ifTrue:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3789
        KnownPackages := Set new.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3790
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3791
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3792
    "/ yes, create any required nameSpace, without asking user.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3793
    Class createNameSpaceQuerySignal answer:true do:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3794
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3795
        [anAbbrevFileStream atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3796
            l := anAbbrevFileStream nextLine withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3797
            l notEmpty ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3798
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3799
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3800
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3801
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3802
                s2 := l readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3803
                [s2 atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3804
                    s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3805
                    s2 peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3806
                        s2 next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3807
                        w := s2 upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3808
                        s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3809
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3810
                        w := s2 upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3811
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3812
                    words add:w
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3813
                ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3814
                words size < 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3815
                    'Smalltalk [warning]: bad abbrev entry' errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3816
                    anAbbrevFileStream isFileStream ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3817
                        ' (in ''' errorPrint. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3818
                        anAbbrevFileStream pathName errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3819
                        ''')' errorPrint
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3820
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3821
                    ': ' errorPrint. l errorPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3822
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3823
                    clsName := (words at:1) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3824
                    abbrev := (words at:2).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3825
                    package := (words at:3) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3826
                    cat := words at:4 ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3827
                    numClassInstVars := words at:5 ifAbsent:'0'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3828
                    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3829
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3830
"/                KnownPackages add:package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3831
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3832
                    (cat size == 0) ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3833
                        cat := 'autoloaded'
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3834
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3835
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3836
                    "/ on the fly, update the abbreviations
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3837
                    self setFilename:abbrev forClass:clsName package:package. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3838
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3839
                    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3840
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3841
                    cls := self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3842
                        installAutoloadedClassNamed:clsName 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3843
                        category:cat 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3844
                        package:package 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3845
                        revision:nil 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3846
                        numClassInstVars:numClassInstVars.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3847
8847
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3848
"/                    info notNil ifTrue:[
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3849
"/                        cls setComment:info.
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3850
"/                    ].
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3851
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3852
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3853
        ]
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3854
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3855
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3856
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3857
loadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3858
    "return true, if binaries should be loaded into the system,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3859
     false if this should be suppressed. The default is false (for now)."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3860
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3861
    ^ LoadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3862
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3863
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3864
loadBinaries:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3865
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3866
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3867
    "turn on/off loading of binary objects"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3868
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3869
    aBoolean ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3870
        (ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3871
            LoadBinaries := true.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3872
            ^ self
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3873
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3874
        'Smalltalk [info]: this system does not support binary loading' infoPrintCR.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3875
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3876
    LoadBinaries := false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3877
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3878
    "Modified: 10.1.1997 / 15:11:00 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3879
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3880
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3881
logDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3882
    "return true if doits should go into the changes file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3883
     as well as changes - by default, this is off, since
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3884
     it can blow up the changes file enormously ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3885
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3886
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3887
    ^ LogDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3888
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3889
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3890
     LogDoits := false
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3891
     LogDoits := true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3892
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3893
!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3894
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3895
logDoits:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3896
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3897
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3898
    "turn on/off logging of doits in the changes file.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3899
     By default, this is off, since it can blow up the 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3900
     changes file enormously ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3901
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3902
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3903
    LogDoits := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3904
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3905
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3906
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3907
makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3908
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3909
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3910
    "walk over all methods and make each a bytecode method
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3911
     iff it does not contain primitive C code.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3912
     Experimental and not yet used."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3913
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3914
    Method allSubInstancesDo:[:aMethod |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3915
        |newMethod|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3916
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3917
        aMethod hasPrimitiveCode ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3918
            newMethod := aMethod asByteCodeMethod.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3919
            newMethod ~~ aMethod ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3920
                aMethod becomeSameAs:newMethod
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3921
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3922
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3923
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3924
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3925
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3926
     Smalltalk makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3927
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3928
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3929
    "Modified: 16.1.1997 / 01:25:58 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3930
    "Created: 17.10.1997 / 13:52:19 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3931
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3932
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3933
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3934
    "read all abbrev.stc files from and under aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3935
     and install autoloaded classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3936
     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3937
     (however, the directories are searched for packages)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3938
     If a file called NOPACKAGES is found, no further searching is done in that directory or below."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3939
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3940
    |abbrevStream dir noAutoloadHere dirName pkgName directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3941
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3942
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3943
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3944
        ^ self
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3945
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3946
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3947
    dir := aDirectory asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3948
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3949
    (dirsConsulted includes:dir pathName) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3950
        ^ self
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3951
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3952
    dirsConsulted add:dir pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3953
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3954
    (dir construct:'NOPACKAGES') exists ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3955
        ^ self.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3956
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3957
    (dir construct:'NOSUBAUTOLOAD') exists ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3958
        ^ self.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3959
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3960
    noAutoloadHere := noAutoloadIn.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3961
    noAutoloadHere ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3962
        (dir construct:'NOAUTOLOAD') exists ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3963
            noAutoloadHere := true.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3964
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3965
    ] ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3966
        (dir construct:'AUTOLOAD') exists ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3967
            noAutoloadHere := false.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3968
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3969
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3970
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3971
    ((dir construct:'loadAll') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3972
    or:[(dir construct:'abbrev.stc') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3973
    or:[(dir construct:(dir baseName , '.prj')) exists]]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3974
        KnownPackages isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3975
            KnownPackages := Set new.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3976
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3977
        dirName := dir pathName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3978
        pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3979
        KnownPackages add:pkgName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3980
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3981
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3982
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3983
    "/ suppress installation as autoloaded in this and everything
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3984
    "/ below; however, still traverse the directories to find packages ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3985
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3986
    noAutoloadHere ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3987
        [
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3988
            abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3989
            self installAutoloadedClassesFromStream:abbrevStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3990
            abbrevStream close.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3991
        ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3992
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3993
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3994
    [
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3995
        directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3996
    ] on:FileStream openErrorSignal do:[:ex|
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3997
        "non-accessable directory: we are done"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  3998
        ^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3999
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  4000
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  4001
    directoryContents do:[:aFilename |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4002
        |f|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4003
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4004
        (#(
9550
0a14cf5e209a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9531
diff changeset
  4005
            'objbc'
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4006
            'doc'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4007
            'CVS'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4008
            'bitmaps'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4009
            'resources'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4010
            'source'
9550
0a14cf5e209a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9531
diff changeset
  4011
            'not_delivered'
9565
8a3ce8f701ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9562
diff changeset
  4012
            'not_ported'
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4013
        ) includes:aFilename) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4014
            ((dir baseName ~= 'stx')
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4015
            or:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4016
                (#(
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4017
                    'configurations'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4018
                    'include'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4019
                    'rules'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4020
                    'stc'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4021
                    'support'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4022
                ) includes:aFilename) not]) 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4023
            ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4024
                f := dir construct:aFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4025
                f isDirectory ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4026
                     self 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4027
                        recursiveInstallAutoloadedClassesFrom:f 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4028
                        rememberIn:dirsConsulted    
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4029
                        maxLevels:maxLevels-1
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4030
                        noAutoload:noAutoloadHere
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4031
                        packageTop:packageTopPath.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4032
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4033
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4034
        ].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  4035
    ].
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  4036
5117
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  4037
    "
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  4038
     Smalltalk installAutoloadedClasses
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  4039
    "
9550
0a14cf5e209a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9531
diff changeset
  4040
9565
8a3ce8f701ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9562
diff changeset
  4041
    "Modified: / 17-08-2006 / 16:48:43 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4042
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4043
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4044
replaceReferencesTo:anObject with:newRef
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4045
    |toAdd|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4046
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4047
    toAdd := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4048
    self keysAndValuesDo:[:key :val |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4049
        (key == anObject) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4050
            self shouldImplement.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4051
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4052
        (val == anObject ) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4053
            toAdd add:(key -> newRef)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4054
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4055
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4056
    toAdd do:[:each |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4057
        self at:(each key) put:(each value)
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4058
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4059
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4060
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4061
saveEmergencyImage:aBoolean
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4062
    "set/clear the flag which controls if ST/X should save an
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4063
     emergency image in case of a broken display connection.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4064
     The default is true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4065
     This may be useful, if you work with an unsecure display
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4066
     (serial line), and want to have a chance of proceeding after
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4067
     a crash. In multiheaded applications, this only affects 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4068
     crashes of the master Display connection (the initial connection);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4069
     errors on other displays are reported to the views and treated
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4070
     like window destroy from the windowManager."
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  4071
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  4072
    SaveEmergencyImage := aBoolean
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  4073
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  4074
    "Modified: / 24.10.1997 / 18:22:26 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4075
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4076
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4077
systemOrganization
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4078
    "for partial ST80 compatibility;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4079
     In ST80, Smalltalk organization returns a systemOrganizer, which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4080
     keeps track of class-categories, while all classes return a classOrganizer
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4081
     from #organization, which keeps track of method categories of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4082
     Since in ST/X, Smalltalk is a class, there is now a conflict.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4083
     To make a workaround possible, use #systemOrganization when porting
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4084
     VW apps to ST/X to get the class-categories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4085
     Read the documentation in SystemOrganizer for more info."
3626
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  4086
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  4087
    ^ SystemOrganizer for:nil
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  4088
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  4089
    "Created: / 20.6.1998 / 12:24:02 / cg"
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  4090
    "Modified: / 20.6.1998 / 12:41:34 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4091
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4092
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4093
!Smalltalk class methodsFor:'system management-fileIn'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4094
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4095
fileIn:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4096
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4097
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4098
     This method can load almost anything which makes sense:
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4099
        .st    - source files
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4100
        .cls   - binary smalltalk bytecode files
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4101
        .so    - binary compiled machine code class libraries
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4102
        [.class - java bytecode -- soon to come]"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4103
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4104
    ^ self fileIn:aFileName lazy:nil silent:nil logged:false 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4105
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4106
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4107
     Smalltalk fileIn:'source/TicTacToe.st'
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4108
     Smalltalk fileIn:'binary/TicTacToe.cls'
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4109
     Smalltalk fileIn:'binary/TicTacToe.so'
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4110
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4111
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4112
    "Created: 28.10.1995 / 17:06:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4113
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4114
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4115
fileIn:aFileName inPackage:aPackageID
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4116
    "read in the named file in a packages directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4117
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4118
    |dir|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4119
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4120
    dir := self getPackageDirectoryForPackage:aPackageID.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4121
    dir isNil ifTrue:[^ false].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4122
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4123
    dir := dir asFilename.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4124
    ^ (self fileIn:(dir construct:aFileName))
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4125
      or:[ self fileIn:((dir construct:'source') construct:aFileName) ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4126
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4127
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4128
fileIn:aFileName lazy:lazy
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4129
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4130
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4131
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4132
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4133
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4134
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4135
     code which is known to be syntactically correct."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4136
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4137
    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4138
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4139
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4140
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4141
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4142
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4143
    "Created: 28.10.1995 / 17:06:36 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4144
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4145
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4146
fileIn:aFileName lazy:lazy silent:silent
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4147
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4148
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4149
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4150
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4151
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4152
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4153
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4154
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4155
     Giving nil for silent/lazy will use the current settings."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4156
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4157
    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4158
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4159
    "Created: 28.10.1995 / 17:06:41 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4160
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4161
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4162
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4163
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4164
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4165
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4166
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4167
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4168
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4169
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4170
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4171
     Giving nil for silent/lazy will use the current settings.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4172
     This method can load almost anything which makes sense:
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4173
        .st    - source files
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4174
        .cls   - binary smalltalk bytecode files
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4175
        .so    - binary compiled machine code class libraries
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4176
        [.class - java bytecode -- soon to come]"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4177
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4178
    |fileNameString aStream path morePath bos|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4179
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4180
    fileNameString := aFileNameOrString asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4181
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4182
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4183
     an object or shared object ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4184
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4185
    (ObjectFileLoader notNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4186
    and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4187
        "/ LoadBinaries ifFalse:[^ false].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4188
        path := self getBinaryFileName:fileNameString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4189
        path isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4190
            path := self getSystemFileName:fileNameString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4191
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4192
        path isNil ifTrue:[^ false].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4193
        ^ (ObjectFileLoader loadObjectFile:path) notNil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4194
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4195
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4196
    (fileNameString asFilename hasSuffix:'cls') ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4197
        BinaryObjectStorage notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4198
            aStream := self systemFileStreamFor:fileNameString.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4199
"/            path := self getBinaryFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4200
"/            path isNil ifTrue:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4201
"/            aStream := path asFilename readStream.
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4202
            aStream notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4203
                aStream binary.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4204
                bos := BinaryObjectStorage onOld:aStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4205
                bos next.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4206
                bos close.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4207
                ^ true
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4208
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4209
            ^ false
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4210
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4211
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4212
9837
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4213
    aStream := self systemFileStreamFor:fileNameString.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4214
    aStream isNil ifTrue:[^ false].
9837
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4215
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4216
    (fileNameString includes:$/) ifTrue:[
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4217
        "/ temporarily prepend the files directory
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4218
        "/ to the searchPath.
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4219
        "/ This allows fileIn-driver files to refer to local
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4220
        "/ files via a relative path, and drivers to fileIn other
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4221
        "/ drivers ...
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4222
        morePath := aStream pathName asFilename directoryName.
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4223
    ].
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4224
    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4225
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4226
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4227
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4228
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4229
9837
49efcb62e189 fileIn simplified
Claus Gittinger <cg@exept.de>
parents: 9836
diff changeset
  4230
    "Modified: / 08-09-2006 / 19:21:16 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4231
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4232
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4233
fileIn:aFileName logged:logged
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4234
    "read in the named file - look for it in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4235
     return true if ok, false if failed.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4236
     The argument logged controls, if the changefile is to be updated."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4237
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4238
    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4239
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4240
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4241
     Smalltalk fileIn:'source/TicTacToe.st' logged:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4242
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4243
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4244
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4245
fileInChanges
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4246
    "read in the last changes file - bringing the system to the state it
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4247
     had when left the last time.
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4248
     WARNING: this method is rubbish: it should only read things after the
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4249
              last '**snapshot**' - entry 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4250
              (instead of the complete changes file)."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4251
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4252
    "
400
claus
parents: 396
diff changeset
  4253
     do NOT update the changes file now ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4254
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4255
    self fileIn:ChangeFileName logged:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4256
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4257
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4258
     Smalltalk fileInChanges 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4259
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4260
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4261
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4262
fileInClass:aClassName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4263
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4264
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4265
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4266
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4267
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4268
    ^ self 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4269
        fileInClass:aClassName 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4270
        package:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4271
        initialize:true 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4272
        lazy:false 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4273
        silent:nil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4274
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4275
    "Modified: / 9.1.1998 / 14:41:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4276
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4277
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4278
fileInClass:aClassName fromObject:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4279
    "read in the named object file and dynamic-link it into the system
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4280
     - look for it in some standard places.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4281
     Only install the named class from this object file.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4282
     Return true if ok, false if failed."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4283
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4284
    |path ok|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4285
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4286
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4287
     check if the dynamic loader class is in
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4288
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4289
    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4290
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4291
    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4292
    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4293
    ok ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4294
        SilentLoading ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4295
            Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4296
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4297
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4298
    ^ ok
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4299
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4300
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4301
     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4302
     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4303
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4304
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4305
    "Modified: 10.9.1996 / 20:43:52 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4306
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4307
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4308
fileInClass:aClassName initialize:doInit
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4309
    "find a source/object file for aClassName and -if found - load it.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4310
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4311
     finally source file (.st) in that order.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4312
     The file is first searched for using the class name, then the abbreviated name."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4313
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4314
    ^ self 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4315
        fileInClass:aClassName 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4316
        package:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4317
        initialize:doInit 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4318
        lazy:false 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4319
        silent:nil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4320
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4321
    "Modified: / 9.1.1998 / 14:42:02 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4322
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4323
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4324
fileInClass:aClassName initialize:doInit lazy:loadLazy
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4325
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4326
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4327
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4328
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4329
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4330
     ^ self 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4331
        fileInClass:aClassName 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4332
        package:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4333
        initialize:doInit 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4334
        lazy:loadLazy 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4335
        silent:nil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4336
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4337
    "Modified: / 9.1.1998 / 14:42:19 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4338
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4339
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4340
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent 
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4341
    "find a source/object file for aClassName and -if found - load it.
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4342
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4343
     finally source file (.st), in that order.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4344
     The file is first searched for using the class name, then the abbreviated name.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4345
     The argument doInit controlls if the class should be sent a #initialize after the
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4346
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4347
     should not send notes to the transcript; it can be true, false or nil, where
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4348
     nil uses the value from SilentLoading."
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4349
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4350
    ^ self
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4351
        fileInClass:aClassName 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4352
        package:nil
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4353
        initialize:doInit 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4354
        lazy:loadLazy 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4355
        silent:beSilent
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4356
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4357
    "Modified: / 9.1.1998 / 14:42:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4358
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4359
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4360
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent 
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4361
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4362
     This is the workhorse for autoloading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4363
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4364
     finally source file (.st), in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4365
     The file is first searched for using the class name, then the abbreviated name.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4366
     The argument doInit controlls if the class should be sent a #initialize after the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4367
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4368
     should not send notes to the transcript; it can be true, false or nil, where
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4369
     nil uses the value from SilentLoading."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4370
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4371
    |classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr 
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4372
     fn packageDir packageFile bos hasSuffix|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4373
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4374
    wasLazy := Compiler compileLazy:loadLazy.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4375
    beSilent notNil ifTrue:[
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4376
        wasSilent := self silentLoading:beSilent.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4377
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4378
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4379
    classFileName := Smalltalk fileNameForClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4380
    (classFileName = aClassName) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4381
        "/ no abbrev.stc translation for className 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4382
        (aClassName includes:$:) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4383
            "/ a nameSpace name
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4384
            alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4385
        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4386
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4387
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4388
    hasSuffix := classFileName asFilename suffix notEmptyOrNil.    
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4389
    classFileName asFilename isAbsolute ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4390
        hasSuffix ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4391
            ok := self fileIn:classFileName lazy:loadLazy silent:beSilent.
9805
9de54eb5eeb8 *** empty log message ***
ca
parents: 9674
diff changeset
  4392
        ] ifFalse:[
9de54eb5eeb8 *** empty log message ***
ca
parents: 9674
diff changeset
  4393
            ok := self fileIn:(classFileName,'.st') lazy:loadLazy silent:beSilent.
9de54eb5eeb8 *** empty log message ***
ca
parents: 9674
diff changeset
  4394
        ]
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4395
    ] ifFalse:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4396
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4397
        classFileName := classFileName copyReplaceAll:$: with:$_.
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4398
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4399
        [
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4400
            Class withoutUpdatingChangesDo:
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4401
            [
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4402
                |zarFn zar entry|
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4403
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4404
                ok := false.
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4405
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4406
                package notNil ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4407
                    packageDir := package asString.
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4408
                    packageDir := packageDir copyReplaceAll:$: with:$/.
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4409
                ].
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4410
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4411
                Class packageQuerySignal answer:package
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4412
                do:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4413
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4414
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4415
                         then, if dynamic linking is available, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4416
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4417
                        (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4418
                            sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4419
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4420
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4421
                             first look for a class packages shared binary in binary/xxx.o
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4422
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4423
                            libName := self libraryFileNameOfClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4424
                            libName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4425
                                (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4426
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4427
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4428
                                        ok := self fileInClass:aClassName fromObject:(libName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4429
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4430
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4431
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4432
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4433
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4434
                             then, look for a shared binary in binary/xxx.o
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4435
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4436
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4437
                                (ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4438
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4439
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4440
                                        ok := self fileInClass:aClassName fromObject:(classFileName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4441
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4442
                                    ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4443
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4444
                                            (ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4445
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4446
                                                sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4447
                                                    ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4448
                                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4449
                                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4450
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4451
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4452
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4453
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4454
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4455
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4456
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4457
                         if that did not work, look for a compiled-bytecode file ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4458
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4459
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4460
                            (ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4461
                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4462
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4463
                                    ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4464
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4465
                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4466
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4467
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4468
                         if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4469
                         look for an st-cls file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4470
                         in a package subdir of the source-directory ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4471
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4472
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4473
                            (packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4474
                                packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4475
                                packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4476
                                    packageFile := (packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4477
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4478
                                (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4479
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4480
                                    alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4481
                                        packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4482
                                        packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4483
                                            packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4484
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4485
                                        ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4486
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4487
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4488
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4489
                                zarFn := self getPackageFileName:(packageDir , '/classes.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4490
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4491
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4492
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4493
                                        entry := zar extract:(classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4494
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4495
                                            entry := zar extract:(alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4496
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4497
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4498
                                            bos := BinaryObjectStorage onOld:(entry asByteArray readStream).
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4499
                                            bos next.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4500
                                            bos close.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4501
                                            ok := true
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4502
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4503
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4504
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4505
                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4506
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4507
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4508
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4509
                         if that did not work, look for an st-source file ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4510
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4511
                        ok ifFalse:[                   
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4512
                            fn := classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4513
                            (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4514
                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4515
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4516
                                    fn := alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4517
                                    ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4518
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4519
                                ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4520
                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4521
                                     ... and in the standard source-directory
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4522
                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4523
                                    fn := 'source/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4524
                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4525
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4526
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4527
                                            fn := 'source/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4528
                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4529
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4530
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4531
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4532
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4533
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4534
                             if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4535
                             look for an st-source file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4536
                             in a package subdir of the source-directory ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4537
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4538
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4539
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4540
                                    packageFile := self getPackageFileName:(packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4541
                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4542
                                        packageFile := (packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4543
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4544
                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4545
                                    (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4546
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4547
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4548
                                            packageFile := self getPackageFileName:(packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4549
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4550
                                                packageFile := (packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4551
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4552
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4553
                                            ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4554
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4555
                                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4556
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4557
                                            packageFile := self getPackageFileName:(packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4558
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4559
                                                packageFile := (packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4560
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4561
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4562
                                            (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4563
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4564
                                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4565
                                                    packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4566
                                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4567
                                                        packageFile := (packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4568
                                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4569
                                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4570
                                                    ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4571
                                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4572
                                                ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4573
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4574
                                                     ... and in the standard source-directory
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4575
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4576
                                                    fn := 'source/' , packageDir , '/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4577
                                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4578
                                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4579
                                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4580
                                                            fn := 'source/' , packageDir , '/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4581
                                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4582
                                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4583
                                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4584
                                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4585
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4586
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4587
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4588
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4589
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4590
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4591
                             if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4592
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4593
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4594
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4595
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4596
                                    zarFn := self getPackageFileName:(packageDir , '/source.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4597
                                    zarFn isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4598
                                        zarFn := packageDir asFilename withSuffix:'zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4599
                                        zarFn := self getSourceFileName:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4600
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4601
                                    zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4602
                                        zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4603
                                        zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4604
                                            entry := zar extract:(classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4605
                                            (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4606
                                                entry := zar extract:(alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4607
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4608
                                            entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4609
                                                fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4610
                                                ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4611
                                                        fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4612
                                                        lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4613
                                                        silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4614
                                                        logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4615
                                                        addPath:nil
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4616
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4617
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4618
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4619
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4620
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4621
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4622
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4623
                             if that did not work, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4624
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4625
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4626
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4627
                                zarFn := self getSourceFileName:'source.zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4628
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4629
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4630
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4631
                                        entry := zar extract:(zarFn := classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4632
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4633
                                            entry := zar extract:(zarFn := alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4634
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4635
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4636
                                            fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4637
                                            ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4638
                                                    fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4639
                                                    lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4640
                                                    silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4641
                                                    logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4642
                                                    addPath:nil
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4643
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4644
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4645
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4646
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4647
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4648
                                "
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4649
                                 if there is a sourceCodeManager, ask it for the classes sourceCode
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4650
                                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4651
                                (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4652
                                    inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4653
                                    inStream notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4654
                                        fn := nil.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4655
                                        ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4656
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4657
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4658
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4659
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4660
                ]
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4661
            ].
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4662
        ] ensure:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4663
            Compiler compileLazy:wasLazy. 
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4664
            wasSilent notNil ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4665
                self silentLoading:wasSilent
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4666
            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4667
        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4668
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4669
    ].
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4670
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4671
    ok ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4672
        newClass := self at:(aClassName asSymbol).
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4673
        newClass notNil ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4674
            fn notNil ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4675
                newClass getClassFilename isNil ifTrue:[
9927
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
  4676
                    newClass setClassFilename:(fn asFilename baseName)
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4677
                ].
9598
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4678
            ].
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4679
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4680
            doInit ifTrue:[
83f8c8faeef3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9565
diff changeset
  4681
                newClass initialize
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4682
            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4683
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4684
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4685
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4686
    ^ newClass
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4687
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4688
    "Created: / 9.1.1998 / 14:40:32 / cg"
4277
74196836e8df oops - care for module-prefix when filing in
Claus Gittinger <cg@exept.de>
parents: 4150
diff changeset
  4689
    "Modified: / 5.6.1999 / 14:53:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4690
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4691
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4692
fileInClassLibrary:aClassLibraryName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4693
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4694
     and load it. This install all of its contained classes.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4695
     Return true if ok, false if not.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4696
     Notice: the argument may not have an extension (by purpose);
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4697
             the sharedLib extension (.dll / .so / .sl) is added here, to
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4698
             make the caller independent of the underlying operatingSystem."
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4699
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4700
    |path fn|
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4701
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4702
    ObjectFileLoader isNil ifTrue:[^ false].
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4703
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4704
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
6836
11fd536a8e02 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6819
diff changeset
  4705
    fn := fn pathName.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4706
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4707
    path := self getBinaryFileName:fn.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4708
    path isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4709
        path := self getSystemFileName:fn.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4710
    ].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4711
    path isNil ifTrue:[^ false].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4712
4714
5da464c01bfd Fix #fileInClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
  4713
    ^ (ObjectFileLoader loadObjectFile:path) notNil
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4714
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4715
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4716
     Smalltalk fileInClassLibrary:'libtable'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4717
     Smalltalk fileInClassLibrary:'binary/libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4718
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4719
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4720
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4721
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4722
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4723
fileInClassLibrary:aClassLibraryName inPackage:packageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4724
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4725
     and load it. This install all of its contained classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4726
     Return true if ok, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4727
     Notice: the argument may not have an extension (by purpose);
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4728
             the sharedLib extension (.dll / .so / .sl) is added here, to
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4729
             make the caller independent of the underlying operatingSystem."
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4730
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4731
    |path fn|
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4732
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4733
    ObjectFileLoader isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4734
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4735
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4736
    fn := fn pathName.
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4737
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4738
    path := self getPackageDirectoryForPackage:packageID.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4739
    path isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4740
    path := path asFilename construct:fn.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4741
    path exists ifFalse:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4742
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4743
    ^ (ObjectFileLoader loadObjectFile:path pathName) notNil
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4744
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4745
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4746
     Smalltalk fileInClassLibrary:'libtable'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4747
     Smalltalk fileInClassLibrary:'binary/libwidg3'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4748
     Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4749
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4750
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4751
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4752
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4753
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4754
fileInStream:streamArg
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4755
    ^ self fileInStream:streamArg lazy:nil silent:nil logged:false addPath:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4756
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4757
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4758
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4759
    "read sourceCode from aStream;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4760
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4761
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4762
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4763
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4764
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4765
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4766
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4767
     Giving nil for silent/lazy will use the current settings.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4768
     If morePath is nonNil, it is prepended to the systemPath temporarily during the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4769
     fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4770
     using a relative path."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4771
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4772
    |inStream decoder wasLazy wasSilent oldSystemPath oldRealPath encoding|
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4773
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4774
    inStream := streamArg.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4775
    inStream isNil ifTrue:[^ false].
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4776
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8695
diff changeset
  4777
    encoding := CharacterEncoder guessEncodingOfStream:inStream.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4778
    encoding notNil ifTrue:[
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4779
        decoder := CharacterEncoder encoderFor:encoding.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4780
        inStream := EncodedStream stream:inStream encoder:decoder.
8712
bcef3a0c0a1d skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  4781
        inStream skipEncodingChunk.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4782
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4783
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4784
    lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4785
    silent notNil ifTrue:[wasSilent := self silentLoading:silent].
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4786
    morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4787
        oldSystemPath := SystemPath copy.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4788
        SystemPath addFirst:morePath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4789
        oldRealPath := RealSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4790
        RealSystemPath := nil.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4791
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4792
    [
8695
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4793
        (Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4794
            inStream fileIn.
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4795
        ]
6421
58dca33cf0fc #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 6403
diff changeset
  4796
    ] ensure:[
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4797
        morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4798
            "take care, someone could have changed SystemPath during fileIn!!"
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4799
            (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4800
                SystemPath := oldSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4801
                RealSystemPath := oldRealPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4802
            ] ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4803
                (oldSystemPath includes:morePath) ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4804
                    SystemPath remove:morePath ifAbsent:[].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4805
                ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4806
                RealSystemPath := nil.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4807
            ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4808
        ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4809
        lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. 
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4810
        silent notNil ifTrue:[self silentLoading:wasSilent].
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4811
        inStream close
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4812
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4813
    ^ true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4814
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4815
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4816
     Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4817
    "
1896
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4818
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4819
    "Modified: 5.11.1996 / 20:03:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4820
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4821
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4822
isClassLibraryLoaded:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4823
    "return true, if a particular class library is already loaded"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4824
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4825
    ObjectMemory 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4826
        binaryModuleInfo 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4827
            do:[:entry | 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4828
                   entry type == #classLibrary ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4829
                       entry libraryName = name ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4830
                          ^ true        "/ already loaded
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4831
                       ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4832
                   ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4833
               ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4834
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4835
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4836
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4837
    "
9638
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4838
     Smalltalk isClassLibraryLoaded:'libstx_libbasic' 
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4839
     Smalltalk isClassLibraryLoaded:'libstx_libwidg3' 
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4840
     Smalltalk isClassLibraryLoaded:'libstx_libboss' 
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4841
    "
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4842
53ee313fe22a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9600
diff changeset
  4843
    "Modified: / 23-08-2006 / 15:54:46 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4844
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4845
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4846
loadClassLibraryIfAbsent:name
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4847
    "dynamically load a classLibrary, if not already loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4848
     and the system supports dynamic loading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4849
     Return true, if the library is loaded, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4850
     This entry is called without system specific filename
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4851
     extensions - it is portable among different architectures
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4852
     as long as corresponding files (x.so / x.dll / x.sl / x.o) 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4853
     are be present ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4854
5881
81a349eab73c added #isClassLibraryLoaded:
Claus Gittinger <cg@exept.de>
parents: 5878
diff changeset
  4855
    (self isClassLibraryLoaded:name) ifTrue:[ ^ true ].  "/ already loaded
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4856
    ^ self fileInClassLibrary:name
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4857
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4858
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4859
     Smalltalk loadClassLibraryIfAbsent:'libbasic'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4860
     Smalltalk loadClassLibraryIfAbsent:'libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4861
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4862
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4863
    "Modified: 31.10.1996 / 16:57:24 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4864
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4865
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4866
secureFileIn:aFileName 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4867
    "read in the named file, looking for it at standard places.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4868
     Catch any error during fileIn. Return true if ok, false if failed"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4869
    
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4870
    |retVal|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4871
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4872
    retVal := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4873
    (SignalSet with:AbortOperationRequest with:TerminateProcessRequest) 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4874
        handle:[:ex | ex return ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4875
        do:[ retVal := self fileIn:aFileName ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4876
    ^ retVal
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4877
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4878
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4879
silentFileIn:aFilename
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4880
    "same as fileIn:, but do not output 'compiled...'-messages on Transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4881
     Main use is during startup."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4882
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4883
    |wasSilent|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4884
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4885
    wasSilent := self silentLoading:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4886
    [
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4887
        self fileIn:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4888
    ] ensure:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4889
        self silentLoading:wasSilent
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4890
    ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4891
! !
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4892
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4893
!Smalltalk class methodsFor:'system management-files'!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4894
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4895
bitmapFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4896
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4897
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4898
     Searches in subdirectories named 'bitmaps' in the SystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4899
     Notice: this does not look in the package-specific bitmaps directories."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4900
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4901
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4902
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4903
    aString := self getBitmapFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4904
    aString notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4905
        ^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4906
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4907
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4908
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4909
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4910
bitmapFromFileNamed:aFileName forClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4911
    "search aFileName in some standard places:
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4912
     first in the redefinable bitmaps path, 
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4913
     then in the classes own package directory if existing.
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4914
     Return an image or nil."
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4915
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4916
    ^ self imageFromFileNamed:aFileName inPackage:(aClass package)
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4917
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4918
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4919
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4920
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4921
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4922
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4923
bitmapFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4924
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4925
     first in the redefinable bitmaps path, 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4926
     then in the package directory if existing.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4927
     Return an image or nil."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4928
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4929
    ^ self imageFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4930
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4931
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4932
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4933
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4934
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4935
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4936
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4937
classNameForFile:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4938
    "return the className which corresponds to an abbreviated fileName,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4939
     or nil if no special translation applies. The given filename arg may
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4940
     include a '.st' suffix (but no other)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4941
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4942
    |fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4943
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4944
    (aFileName asFilename hasSuffix:'st') ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4945
        fn := aFileName copyWithoutLast:3
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4946
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4947
        fn := aFileName
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4948
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4949
    ^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4950
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4951
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4952
     Smalltalk classNameForFile:'DrawObj'  
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4953
     Smalltalk classNameForFile:'DrawObj.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4954
     Smalltalk classNameForFile:'ArrColl.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4955
     Smalltalk classNameForFile:'ArrColl.chg' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4956
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4957
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4958
    "Modified: 11.12.1995 / 14:51:10 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4959
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4960
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4961
constructPathFor:aDirectoryName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4962
    "search for aDirectory in SystemPath; 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4963
     return a collection of pathes which include that directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4964
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4965
    ^ self realSystemPath select:[:dirName |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4966
        |fullPath|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4967
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4968
        fullPath := dirName asFilename construct:aDirectoryName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4969
        "/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4970
        fullPath isDirectory and:[fullPath isReadable]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4971
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4972
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4973
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4974
fileInFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4975
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4976
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4977
     Searches in subdirectories named 'fileIn' in SystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4978
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4979
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4980
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4981
    aString := self getFileInFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4982
    aString notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  4983
        ^ aString asFilename readStreamOrNil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4984
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4985
    ^ nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4986
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4987
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4988
fileNameForClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4989
    "return a filename for aClassOrClassName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4990
9915
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  4991
    |cls nonMetaclass nm1 nm2|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4992
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4993
    aClassOrClassName isBehavior ifTrue:[
9915
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  4994
        nonMetaclass := aClassOrClassName theNonMetaclass.
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  4995
        nm1 := nonMetaclass name.
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  4996
        nm2 := nonMetaclass nameWithoutPrefix.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4997
    ] ifFalse:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4998
        cls := Smalltalk classNamed:aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4999
        cls notNil ifTrue:[
9915
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  5000
            nonMetaclass := cls theNonMetaclass.
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  5001
            nm1 := nonMetaclass name.
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  5002
            nm2 := nonMetaclass nameWithoutPrefix.
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5003
        ] ifFalse:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5004
            nm1 := aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5005
            nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1).
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5006
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5007
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5008
    nm1 := nm1 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5009
    nm2 := nm2 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5010
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5011
    CachedAbbreviations notNil ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5012
        (CachedAbbreviations includesKey:nm1) ifTrue:[
9915
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  5013
            ^ (CachedAbbreviations at:nm1) asFilename baseName
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5014
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5015
        (CachedAbbreviations includesKey:nm2) ifTrue:[
9915
e8a68bd572b9 cached filename access.
Claus Gittinger <cg@exept.de>
parents: 9910
diff changeset
  5016
            ^ (CachedAbbreviations at:nm2) asFilename baseName
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5017
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5018
    ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5019
    ^ nm1 copyReplaceAll:$: with:$_
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  5020
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5021
    "
7723
ed4ce2184b37 Fix #filenameForClass: handling of abbreviations
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  5022
     Smalltalk fileNameForClass:#Complex    
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5023
     Smalltalk fileNameForClass:'SmallInteger'    
3678
606bf9fca8f2 infoPrint.
Claus Gittinger <cg@exept.de>
parents: 3627
diff changeset
  5024
     Smalltalk fileNameForClass:'UnixOperatingSystem' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  5025
     Smalltalk fileNameForClass:'Launcher'        
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5026
     Smalltalk fileNameForClass:'SomeUnknownClass' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  5027
     Smalltalk fileNameForClass:OSI::FTAMOperation 
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  5028
     Smalltalk fileNameForClass:'OSI::Foobar' 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5029
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5030
6151
e36a9b339582 isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6121
diff changeset
  5031
    "Modified: / 5.11.2001 / 16:49:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5032
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5033
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5034
filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5035
    "return a dictionary containing the classname-to-filename
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5036
     mappings. (needed for sys5.3 users, where filenames are limited
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5037
     to 14 chars)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5038
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5039
    CachedAbbreviations isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5040
        self readAbbreviations
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5041
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5042
    ^ CachedAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5043
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5044
    "flush with:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5045
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5046
     CachedAbbreviations := nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5047
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5048
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5049
     Smalltalk filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5050
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5051
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5052
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5053
flushPathCaches
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5054
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5055
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5056
    "forget pathCaches - these are collections containing valid directory names,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5057
     where system files (resource, bitmaps etc.) are found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5058
     A flush is only required, if a new system directory has been created while
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5059
     the system is active, and those files should override the others
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5060
     (for example, if you created a private resource directory)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5061
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5062
    RealSystemPath := ResourcePath := SourcePath := 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5063
    BitmapPath := BinaryPath := FileInPath := nil
2378
e76870d427ee commentary
ca
parents: 2374
diff changeset
  5064
e76870d427ee commentary
ca
parents: 2374
diff changeset
  5065
    "
e76870d427ee commentary
ca
parents: 2374
diff changeset
  5066
     Smalltalk flushPathCaches
e76870d427ee commentary
ca
parents: 2374
diff changeset
  5067
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5068
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5069
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5070
getBinaryFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5071
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5072
     (subdirectories named 'binary' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5073
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5074
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5075
    BinaryPath isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5076
        BinaryPath := self constructPathFor:BinaryDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5077
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5078
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
  5079
    ^ self searchPath:BinaryPath for:aFileName in:BinaryDirName
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5080
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5081
    "Modified: 18.7.1996 / 15:53:49 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  5082
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  5083
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5084
getBitmapFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5085
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5086
     (subdirectories named 'bitmaps' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5087
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5088
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5089
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5090
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5091
    BitmapPath isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5092
        BitmapPath := self constructPathFor:BitmapDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5093
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5094
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5095
    "/ first, try a bitmaps subdir along the path.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5096
    f := self searchPath:BitmapPath for:aFileName in:BitmapDirName.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5097
    f isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5098
        "/ then, try it itself along the path.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5099
        f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5100
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5101
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5102
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5103
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5104
     Smalltalk getBitmapFileName:'SBrowser.xbm'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5105
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5106
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5107
    "Modified: 18.7.1996 / 15:53:55 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5108
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5109
9836
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5110
getBitmapFileName:aFileName forPackage:aPackageIDOrNil
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5111
    "search aFileName in some standard places 
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5112
     (subdirectories named 'bitmaps' in SystemPath);
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5113
     and in a packages directory.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5114
     Return the absolute filename or nil if none is found."
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5115
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5116
    |f packageDir dir|
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5117
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5118
    f := self getBitmapFileName:aFileName.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5119
    f notNil ifTrue:[^ f].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5120
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5121
    aPackageIDOrNil isNil ifTrue:[ ^ nil].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5122
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5123
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5124
    self packagePath do:[:aPath |
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5125
        |pD|
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5126
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5127
        pD := aPath asFilename construct:packageDir.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5128
        pD exists ifTrue:[
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5129
            f := pD construct:aFileName.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5130
            f exists ifTrue:[
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5131
                ^ f pathName
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5132
            ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5133
            f := (pD construct:'bitmaps') construct:aFileName.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5134
            f exists ifTrue:[
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5135
                ^ f pathName
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5136
            ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5137
        ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5138
    ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5139
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5140
    dir := Smalltalk getPackageDirectoryForPackage:aPackageIDOrNil.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5141
    dir notNil ifTrue:[
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5142
        f := (dir asFilename construct:'bitmaps') construct:aFileName.
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5143
        f exists ifTrue:[
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5144
            ^ f pathName
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5145
        ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5146
    ].
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5147
9838
ce6c06785618 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9837
diff changeset
  5148
    (aFileName startsWith:'bitmaps') ifTrue:[
ce6c06785618 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9837
diff changeset
  5149
        ^ self searchPath:ResourcePath for:aFileName in:('resources/',packageDir).
ce6c06785618 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9837
diff changeset
  5150
    ].
9836
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5151
    ^ self searchPath:ResourcePath for:('bitmaps/',aFileName) in:('resources/',packageDir).
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5152
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5153
    "
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5154
     Smalltalk getBitmapFileName:'Request_XP.xpm' forPackage:'stx:libwidg'
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5155
    "
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5156
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5157
    "Created: / 08-09-2006 / 18:01:36 / cg"
9838
ce6c06785618 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9837
diff changeset
  5158
    "Modified: / 08-09-2006 / 20:17:24 / cg"
9836
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5159
!
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5160
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5161
getFileInFileName:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5162
    "search aFileName in some standard places 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5163
     (subdirectories named 'fileIn' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5164
     return the absolute filename or nil if none is found."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5165
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5166
    FileInPath isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5167
        FileInPath := self constructPathFor:FileInDirName
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5168
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5169
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5170
    ^ self searchPath:FileInPath for:aFileName in:FileInDirName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5171
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5172
    "Modified: 18.7.1996 / 15:53:59 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5173
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5174
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5175
getPackageDirectoryForPackage:aPackageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5176
    "search for a particular package; return its directory, or nil"
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5177
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5178
    |checkForPackageDirectory module packageSubDirectory|
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5179
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5180
    module := aPackageID asPackageId module.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5181
    packageSubDirectory := aPackageID asPackageId directory.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5182
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5183
    checkForPackageDirectory := 
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5184
        [:moduleDir |
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5185
            |packageDir|
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5186
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5187
            (moduleDir exists and:[moduleDir isDirectory]) ifTrue:[
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5188
                packageDir := moduleDir construct:packageSubDirectory.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5189
                (packageDir exists and:[packageDir isDirectory]) ifTrue:[
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5190
                    ^ packageDir
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5191
                ]
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5192
            ].
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5193
        ].
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5194
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5195
    self packagePath do:[:aPath |
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5196
        |moduleDir|
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5197
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5198
        moduleDir := aPath asFilename construct:module.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5199
        checkForPackageDirectory value:moduleDir.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5200
    ].
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5201
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5202
    "/ not found - special case for the stx package...
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5203
    module = 'stx' ifTrue:[
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5204
        checkForPackageDirectory value:('../../' asFilename).
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5205
    ].
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5206
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5207
    ^ nil
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5208
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5209
    "
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5210
     Smalltalk getPackageDirectoryForPackage:(Array package)
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5211
     Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps'
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  5212
     Smalltalk getPackageDirectoryForPackage:'stx:libview'
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  5213
    "
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5214
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  5215
    "Modified: / 06-10-2006 / 11:49:27 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5216
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5217
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5218
getPackageFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5219
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5220
     (packagePath and subdirectories named 'packages' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5221
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5222
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5223
    |f|
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5224
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5225
    "/ search along packagePath ...
5052
31a76937dec2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5051
diff changeset
  5226
    f := self searchPath:self packagePath for:aFileName in:nil.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5227
    f isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5228
        "/ search under packages-directory along systemPath ...
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5229
        f := self searchPath:self realSystemPath for:aFileName in:PackageDirName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5230
        "/ kludge - allow for stx-directory to be named differently
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5231
        f isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5232
            (aFileName startsWith:'stx') ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5233
                (aFileName startsWith:'stx' , Filename separator) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5234
                    f := '../..' asFilename construct:(aFileName copyFrom:5).
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5235
                    f exists ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5236
                        ^ f pathName
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5237
                    ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5238
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5239
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5240
        ].
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5241
    ].
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  5242
    (f notNil and:[(f := f asFilename) exists]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5243
        ^ f pathName
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  5244
    ].
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  5245
    ^ nil
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5246
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5247
    "
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5248
     Smalltalk getPackageFileName:'stx/libview/resources/normal.style'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5249
     Smalltalk getPackageFileName:'stx/libview/source.zip'    
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5250
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5251
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5252
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5253
getResourceFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5254
    "search aFileName in some standard places 
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5255
     (subdirectories named 'resources' in SystemPath);
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5256
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5257
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5258
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5259
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5260
    ResourcePath isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5261
        ResourcePath := self constructPathFor:ResourceDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5262
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5263
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5264
    "/ first, try a resource subdir along the path.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5265
    f := self searchPath:ResourcePath for:aFileName in:ResourceDirName.
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5266
    f isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5267
        "/ then, try it itself along the path.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5268
        f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5269
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  5270
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5271
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5272
    "
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5273
     Smalltalk getResourceFileName:'SystemBrowser.rs'
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5274
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5275
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5276
    "Modified: 18.7.1996 / 15:54:03 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5277
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5278
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5279
getResourceFileName:aFileName forClass:aClassOrNil
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  5280
    "search aFileName in some standard places 
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5281
     (subdirectories named 'resource' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5282
     and in aClasses package directory.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5283
     Return the absolute filename or nil if none is found."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5284
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5285
    |pkgOrNil|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5286
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5287
    aClassOrNil notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5288
        pkgOrNil := aClassOrNil package.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5289
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5290
    ^ self getResourceFileName:aFileName forPackage:pkgOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5291
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5292
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5293
     Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5294
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5295
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5296
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5297
getResourceFileName:aFileName forPackage:aPackageIDOrNil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5298
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5299
     (subdirectories named 'resource' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5300
     and in a packages directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5301
     Return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5302
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5303
    |f dir packageDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5304
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5305
    f := self getResourceFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5306
    f notNil ifTrue:[^ f].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5307
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5308
    aPackageIDOrNil isNil ifTrue:[ ^ nil].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5309
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5310
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5311
    self packagePath do:[:aPath |
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5312
        |pD|
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5313
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5314
        pD := aPath asFilename construct:packageDir.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5315
        pD exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5316
            f := pD construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5317
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5318
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5319
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5320
            f := (pD construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5321
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5322
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5323
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5324
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5325
    ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5326
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5327
    dir := Smalltalk getPackageDirectoryForPackage:(aPackageIDOrNil ? 'stx:libview').
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5328
    dir notNil ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5329
        f := (dir asFilename construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5330
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5331
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5332
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5333
        f := (dir asFilename construct:'styles') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5334
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5335
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5336
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5337
    ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5338
8951
7cabfee1b791 resource file search
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
  5339
    ^ self searchPath:ResourcePath for:aFileName in:('resources/',packageDir).
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5340
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5341
    "
5065
a7ae2d968496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5064
diff changeset
  5342
     Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool'
5080
b600259b45b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
  5343
     Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5344
     Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5345
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5346
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5347
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5348
getSourceFileName:aFileName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5349
    "search aFileName in some standard places 
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5350
     (subdirectories named 'source' in SystemPath);
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5351
     return the absolute filename or nil if none is found.
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5352
     This is used to find a sourceFile for a methods source,
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5353
     if no sourceCodeManager is available."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5354
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5355
    |f|
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5356
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5357
    SourcePath isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5358
        SourcePath := self constructPathFor:SourceDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5359
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5360
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5361
    "/ first, try a source subdir along the path.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5362
    SourcePath notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5363
        f := self searchPath:SourcePath for:aFileName in:SourceDirName.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5364
    ].
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5365
    f isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5366
        "/ then, try it itself along the path.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5367
        f := self searchPath:self realSystemPath for:aFileName in:nil
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5368
    ].
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5369
    ^ f
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5370
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5371
    "
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5372
     Smalltalk getSourceFileName:'Smalltalk.st'  
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5373
     Smalltalk getSourceFileName:'ArrColl.st' 
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5374
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5375
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5376
    "Modified: 18.7.1996 / 15:54:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5377
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5378
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5379
getSystemFileName:aFileNameOrString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5380
    "search aFileNameOrString in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5381
     return the absolute filename or nil if none is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5382
     see comment in Smalltalk>>initSystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5383
     This should be used to access resources such as bitmaps, doc-files,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5384
     and other help files.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5385
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5386
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5387
    "credits for this method go to Markus ...."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5388
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5389
    |fn nameString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5390
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5391
    fn := aFileNameOrString asFilename.
2933
8b65cb642d91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2928
diff changeset
  5392
    nameString := fn name.
2896
be30640b9012 VMS stuff
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  5393
    fn isAbsolute ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5394
        "dont use path for absolute file names"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5395
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5396
        ^ nameString
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5397
    ].
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5398
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5399
    self realSystemPath do:[:dirName |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5400
        |realName|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5401
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5402
        realName := dirName asFilename construct:nameString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5403
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5404
        "/ here, we also return true if its a directory
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5405
        "/ (Even if unreadable). 
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5406
        "/ It could be that the file itself is still readable.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5407
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5408
        (realName isDirectory or:[realName isReadable]) ifTrue: [
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5409
            ^ realName name
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5410
        ]
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5411
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5412
    ^ nil
4150
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5413
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5414
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5415
     Smalltalk getSystemFileName:'doc/online/english/TOP.html'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5416
     Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5417
     Smalltalk getSystemFileName:'bitmaps/foo'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5418
     Smalltalk getSystemFileName:'resources/View.rs'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5419
     Smalltalk getSystemFileName:'resources/iris.style'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5420
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5421
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5422
    "Modified: / 6.5.1999 / 10:40:37 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5423
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5424
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5425
imageFromFileNamed:aFileName forClass:aClass
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5426
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5427
     first in the redefinable bitmaps path, then in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5428
     own package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5429
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5430
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5431
    |package nm img|
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5432
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5433
    package := aClass package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5434
    img := self imageFromFileNamed:aFileName inPackage:package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5435
    img isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5436
        package ~= 'stx:goodies' ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5437
            "/ try under the goodies package ...
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5438
            img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5439
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5440
        img isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5441
            (aFileName startsWith:'bitmaps') ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5442
                nm := 'bitmaps/' , aFileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5443
                img := Smalltalk imageFromFileNamed:nm forClass:self.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5444
                img isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5445
                    img := Smalltalk imageFromFileNamed:nm inPackage:'stx:goodies'.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5446
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5447
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5448
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5449
            img isNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5450
                img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5451
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5452
        ]
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5453
    ].
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5454
    ^ img
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5455
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5456
    "
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5457
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5458
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5459
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5460
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5461
imageFromFileNamed:aFileName inPackage:aPackage
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5462
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5463
     first in the redefinable bitmaps path, then in the 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5464
     package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5465
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5466
9200
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5467
    |i f dir packageDir pF|
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5468
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5469
    i := Image fromFile:aFileName resolution:100.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5470
    i notNil ifTrue:[^ i].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5471
9836
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5472
    f := self getBitmapFileName:aFileName forPackage:aPackage.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5473
    f notNil ifTrue:[
9199
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5474
        i := Image fromFile:f.
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5475
        i notNil ifTrue:[^ i].
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5476
    ].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5477
    dir := self projectDirectoryForPackage:aPackage.
9199
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5478
    dir notNil ifTrue:[
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5479
        ((f := aFileName) startsWith:'bitmaps/') ifFalse:[
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5480
            i := Image fromFile:(dir asFilename construct:f).
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5481
            i notNil ifTrue:[^ i].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5482
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5483
            f := 'bitmaps/' , aFileName.
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5484
        ].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5485
    ].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5486
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5487
    packageDir := aPackage copyReplaceAll:$: with:$/.
9200
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5488
    pF := self searchPath:ResourcePath for:aFileName in:('bitmaps/',packageDir).
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5489
    pF notNil ifTrue:[
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5490
        i := Image fromFile:pF.
9199
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5491
        i notNil ifTrue:[^ i].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5492
    ].
9200
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5493
    pF := self searchPath:ResourcePath for:aFileName in:('resources/',packageDir,'/bitmaps').
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5494
    pF notNil ifTrue:[
5cb7c708a1d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9199
diff changeset
  5495
        i := Image fromFile:pF.
9199
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5496
        i notNil ifTrue:[^ i].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5497
    ].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5498
    dir notNil ifTrue:[
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5499
        ^ Image fromFile:(dir asFilename construct:f).
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5500
    ].
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5501
    ^ nil
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5502
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5503
    "
5587
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5504
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5505
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5506
     Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' 
9199
c4b24602dbdb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9104
diff changeset
  5507
     Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg' 
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5508
    "
9836
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5509
04c547ada7c6 bitmap filesearch
Claus Gittinger <cg@exept.de>
parents: 9822
diff changeset
  5510
    "Modified: / 08-09-2006 / 18:02:04 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5511
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5512
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5513
libraryFileNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5514
    "for a given class, return the name of a classLibrary which contains
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5515
     binary code for it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5516
     Read the libinfo file 'liblist.stc' (which is created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5517
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5518
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5519
     the 2nd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5520
     Return nil if no entry is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5521
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5522
     A nil returns means that this class is either built-in or not present
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5523
     in a package-class library (i.e. either as separate .o or separate .st file).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5524
     Otherwise, the returned name is the classLibrary object of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5525
     The classes code can be loaded from that file if binary loading is supported."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5526
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5527
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5528
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5529
    aClassOrClassName isBehavior ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5530
        aClassName := aClassOrClassName name
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5531
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5532
        aClassName := aClassOrClassName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5533
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5534
    aClassName := aClassName asString.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5535
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5536
    #('include/liblist.stc')    "/ filenames
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5537
    with:#(2)                   "/ column
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5538
    do:[:fileName :col |
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5539
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5540
        aStream := self systemFileStreamFor:fileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5541
        aStream notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5542
            [aStream atEnd] whileFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5543
                line := aStream nextLine.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5544
                line notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5545
                    (line startsWith:'#') ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5546
                        words := line asCollectionOfWords.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5547
                        (n := words size) > 1 ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5548
                            (words at:1) = aClassName ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5549
                                n >= col ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5550
                                    aStream close.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5551
                                    ^ (words at:col) withoutSeparators
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5552
                                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5553
                            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5554
                        ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5555
                    ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5556
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5557
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5558
            aStream close
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5559
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5560
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5561
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5562
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5563
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5564
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5565
     Smalltalk libraryFileNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5566
     Smalltalk libraryFileNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5567
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5568
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5569
    "Modified: 6.11.1995 / 15:41:39 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5570
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5571
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5572
packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5573
    "return a collection of additional directorynames, where smalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5574
     looks for package directories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5575
     Notice, that directories named 'packages' under the systemPath are
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5576
     always consulted - even if not in the packagePath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5577
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5578
    ^ PackagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5579
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5580
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5581
     Smalltalk packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5582
     Smalltalk packagePath addLast:'/opt/smalltalk'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5583
     Smalltalk packagePath addFirst:'/usr/local/otherPackages'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5584
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5585
!
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5586
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5587
packagePath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5588
    "set the packagePath;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5589
     a collection of additional directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5590
     looks for package directories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5591
     Notice, that directories named 'packages' under the systemPath are
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5592
     always consulted - even if not in the packagePath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5593
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5594
    PackagePath := aPath asOrderedCollection
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5595
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5596
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5597
     Smalltalk packagePath:#( '.' '/opt/stx' '/opt/smalltalk' '/usr/local/otherPackages')
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5598
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5599
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5600
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5601
projectDirectoryForClass:aClass
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5602
    "given a class, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5603
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5604
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5605
    |pkg|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5606
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5607
    pkg := aClass package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5608
    pkg isNil ifTrue:[^ nil].
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5609
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5610
    ^ self projectDirectoryForPackage:pkg.
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5611
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5612
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5613
     Smalltalk projectDirectoryForClass:Array 
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5614
     Smalltalk projectDirectoryForClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5615
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5616
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5617
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5618
projectDirectoryForPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5619
    "given a packageID, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5620
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5621
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5622
    |prj prjDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5623
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5624
    "/ there might be a package specific resource directory ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5625
    "/ in the directory, from which the project was loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5626
    prj := Project projectWithId:aPackage.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5627
    prj notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5628
        prjDir := prj directory.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5629
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5630
    (prjDir notNil and:[prjDir asFilename exists]) ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5631
        prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/).
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5632
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5633
    ^ prjDir
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5634
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5635
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5636
     Smalltalk projectDirectoryForPackage:'stx:libbasic'   
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5637
     Smalltalk projectDirectoryForPackage:'exept:smartcard'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5638
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5639
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5640
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5641
readAbbreviations
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5642
    "read classname to filename mappings from include/abbrev.stc.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5643
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5644
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5645
    "since installAutoloadedClasses also reads all abbreviations, use it"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5646
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5647
    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5648
    self installAutoloadedClasses.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5649
    ^ CachedAbbreviations.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5650
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5651
"/    |aStream f dirsConsulted|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5652
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5653
"/    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5654
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5655
"/    "/ new scheme: look for a directory called 'packages'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5656
"/    "/ and enumerate its abbrev.stc files...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5657
"/    dirsConsulted := Set new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5658
"/    f := Smalltalk getSystemFileName:'packages'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5659
"/    f notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5660
"/        f := f asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5661
"/        f isDirectory ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5662
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , f pathName ,'''') infoPrintCR.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5663
"/            self recursiveReadAllAbbreviationsFrom:f.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5664
"/            dirsConsulted add:f pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5665
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5666
"/    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5667
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5668
"/    "/ and along the package-path
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5669
"/    self packagePath do:[:aPath |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5670
"/        (dirsConsulted includes:aPath) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5671
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , aPath ,'''') infoPrintCR.
7613
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5672
"/            self recursiveReadAllAbbreviationsFrom:aPath.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5673
"/            dirsConsulted add:aPath
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5674
"/        ]
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5675
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5676
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5677
"/    "/ old scheme: look for a single file called 'abbrev.stc' in the
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5678
"/    "/ include directory. This will vanish.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5679
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5680
"/    aStream := self systemFileStreamFor:'include/abbrev.stc'.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5681
"/    aStream notNil ifTrue:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5682
"/        ('Smalltalk [info]: reading additional abbreviations from ''' , aStream pathName ,'''') infoPrintCR.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5683
"/        self readAbbreviationsFromStream:aStream.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5684
"/        aStream close.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5685
"/"/    ] ifFalse:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5686
"/"/        ('Smalltalk [warning]: no global''include/abbrev.stc'' file found') infoPrintCR
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5687
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5688
"/    ^ CachedAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5689
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5690
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5691
     Smalltalk readAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5692
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5693
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5694
    "Modified: / 10.12.1999 / 17:48:53 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5695
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5696
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5697
readAbbreviationsFromStream:aStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5698
    "read classname to filename mappings from aStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5699
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5700
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5701
    |line words nm abbrev pkg s w|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5702
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5703
    [aStream atEnd] whileFalse:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5704
        line := aStream nextLine.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5705
        line notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5706
            (line startsWith:'#') ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5707
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5708
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5709
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5710
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5711
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5712
                s := line readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5713
                [s atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5714
                    s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5715
                    s peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5716
                        s next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5717
                        w := s upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5718
                        s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5719
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5720
                        w := s upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5721
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5722
                    words add:w
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5723
                ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5724
                words size >= 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5725
                    nm := (words at:1) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5726
                    abbrev := (words at:2) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5727
                    pkg := (words at:3) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5728
                    self setFilename:abbrev forClass:nm package:pkg. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5729
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5730
                    ('Smalltalk [warning]: malformed line in ' , (aStream pathName)) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5731
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5732
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5733
        ]
4420
beac992b86d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4391
diff changeset
  5734
    ].
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5735
5095
9bbf3cf594e5 no warning for same-abbrev, if packages differ.
Claus Gittinger <cg@exept.de>
parents: 5093
diff changeset
  5736
    "Modified: / 13.12.1999 / 11:54:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5737
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5738
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5739
realSystemPath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5740
    "return the realSystemPath - thats the directorynames from
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5741
     SystemPath which exist and are readable"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5742
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5743
    |nP|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5744
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5745
    RealSystemPath isNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5746
        OperatingSystem isVMSlike ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5747
            "/ temporary kludge: since we cannot currently
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5748
            "/ check for existance of a name like 'volume:',
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5749
            "/ leave those in the Path without a check.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5750
            RealSystemPath := SystemPath select:[:dirName |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5751
                |f|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5752
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5753
                f := dirName asFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5754
                f isVolumeOnly ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5755
                    true
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5756
                ] ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5757
                    (f isDirectory) and:[f isReadable]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5758
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5759
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5760
        ] ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5761
            RealSystemPath := SystemPath select:[:dirName |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5762
                |f|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5763
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5764
                f := dirName asFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5765
                (f isDirectory) and:[f isReadable]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5766
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5767
            RealSystemPath := RealSystemPath collect:[:dirName |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5768
                    |f|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5769
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5770
                    f := dirName asFilename pathName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5771
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5772
            "/ remove duplicates (but keep order)
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5773
            nP := OrderedCollection new.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5774
            RealSystemPath do:[:p |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5775
                (nP includes:p) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5776
                    nP add:p
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5777
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5778
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5779
            RealSystemPath := nP.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5780
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5781
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5782
    ^ RealSystemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5783
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5784
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5785
recursiveReadAllAbbreviationsFrom:aDirectory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5786
    self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5787
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5788
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5789
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5790
    "read all abbreviations from and under aDirectory."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5791
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5792
    |abbrevStream dir directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5793
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5794
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5795
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5796
        ^ self
5075
c9e585ae97d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5074
diff changeset
  5797
    ].
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  5798
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5799
    dir := aDirectory asFilename.
5057
390bbf7d37bf care for empty directories
Claus Gittinger <cg@exept.de>
parents: 5053
diff changeset
  5800
    dir exists ifFalse:[^ self].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5801
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5802
    [
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5803
        abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5804
        self readAbbreviationsFromStream:abbrevStream.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5805
        abbrevStream close.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5806
    ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5807
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5808
    [
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5809
        directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5810
    ] on:FileStream openErrorSignal do:[:ex|
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5811
        "non-accessable directory: we are done"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5812
        ^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5813
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5814
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5815
    directoryContents do:[:aFilename |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5816
        |f|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5817
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5818
        (#(
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5819
            'doc'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5820
            'CVS'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5821
            'bitmaps'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5822
            'resources'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5823
            'source'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5824
        ) includes:aFilename) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5825
            f := dir construct:aFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5826
            f isDirectory ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5827
                self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5828
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5829
        ].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5830
    ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5831
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5832
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5833
resourceDirectoryForPackage:aPackage
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5834
    "given a packageID, return the path to its resource directory;
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5835
     nil if not found."
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5836
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5837
    |prjDir rsrcDir|
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5838
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5839
    prjDir := self projectDirectoryForPackage:aPackage.
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5840
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5841
    (prjDir notNil
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5842
    and:[(prjDir := prjDir asFilename) exists
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5843
    and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5844
        ^ rsrcDir
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5845
    ].
8953
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5846
    rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)).
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5847
    rsrcDir notNil ifTrue:[
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5848
        ^ rsrcDir asFilename
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5849
    ].
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5850
    ^ nil 
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5851
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5852
    "
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5853
     Smalltalk resourceDirectoryForPackage:'stx:libbasic'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5854
     Smalltalk resourceDirectoryForPackage:'exept:expecco'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5855
     Smalltalk resourceDirectoryForPackage:'exept:smartcard'
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5856
    "
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5857
!
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5858
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5859
resourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5860
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5861
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5862
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5863
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5864
    ^ self resourceFileStreamFor:aFileName forClass:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5865
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5866
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5867
resourceFileStreamFor:aFileName forClass:aClassOrNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5868
    "search aFileName in some standard places and in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5869
     package-resource directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5870
     Return a readonly fileStream or nil if not found.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5871
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5872
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5873
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5874
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5875
    aString := self getResourceFileName:aFileName forClass:aClassOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5876
    aString notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5877
        ^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5878
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5879
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5880
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5881
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5882
searchPath:aPath for:aFileName in:aDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5883
    "search aPath for a subdirectory named aDirectory with a file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5884
     named aFileName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5885
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5886
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5887
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5888
    ((f := aFileName asFilename) isAbsolute 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5889
    or:[f isExplicitRelative]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5890
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5891
        "/ dont use path for absolute or explicit .-relative file names
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5892
        "/
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5893
        ^ aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5894
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5895
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5896
    aPath notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5897
        aPath do:[:dirName |
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5898
            |realName dir|
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5899
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5900
            dir := dirName asFilename.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5901
            aDirName notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5902
                realName := (dir construct:aDirName) construct:aFileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5903
            ] ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5904
                realName := dir construct:aFileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5905
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5906
            (realName isReadable) ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5907
                ^ realName name
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5908
            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5909
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5910
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5911
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5912
    ^ nil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5913
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5914
    "Modified: / 29.4.1999 / 15:06:43 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5915
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5916
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5917
setFilename:aFileNameString forClass:aClassNameString package:aPackageNameString 
9905
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5918
    |classNameSymbol oldAbbrev oldPath newPath cls abbrevs|
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5919
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5920
    CachedAbbreviations isNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5921
        CachedAbbreviations := IdentityDictionary new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5922
    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5923
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5924
    abbrevs := CachedAbbreviations.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5925
    aClassNameString ~= aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5926
        classNameSymbol := aClassNameString asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5927
        oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5928
        oldAbbrev notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5929
            oldAbbrev ~= aFileNameString ifTrue:[
9905
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5930
                oldAbbrev asFilename isAbsolute 
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5931
                    ifTrue:[ oldPath := oldAbbrev ]
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5932
                    ifFalse:[ oldPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: oldAbbrev ].
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5933
                aFileNameString asFilename isAbsolute 
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5934
                    ifTrue:[ newPath := aFileNameString ]
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5935
                    ifFalse:[ newPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: aFileNameString ].
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5936
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5937
                oldPath ~= newPath ifTrue:[
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5938
                    StandAlone ifFalse:[
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5939
                        ('Smalltalk [warning]: autoload path change for: ',aClassNameString,' in package ',aPackageNameString) infoPrintCR.
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5940
                        ('Smalltalk [info]: old: ',oldPath) infoPrintCR.
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5941
                        ('Smalltalk [info]: new: ',newPath) infoPrintCR.
625e0c143984 abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents: 9838
diff changeset
  5942
                    ]
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5943
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5944
            ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5945
            "overwrite old abbreviation with new one, 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5946
             to allow fixing of bad abbrev files"
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5947
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5948
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5949
        cls := self classNamed:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5950
        cls notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5951
            cls name ~= aClassNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5952
                "/ ok, there is a class named after this abbrev ...
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5953
                "/ this is only a conflict, if the other class has no
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5954
                "/ abbreviation (or the same).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5955
                (abbrevs at:(cls name asSymbol) ifAbsent:cls name) = aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5956
                    cls isNameSpace ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5957
                        aPackageNameString = cls package ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5958
                            StandAlone ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5959
                                ('Smalltalk [warning]: conflict for: ' , cls name , 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5960
                                    ' in package ' , aPackageNameString) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5961
                                ('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5962
                                    , ')') infoPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5963
                            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5964
                        ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5965
                    ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5966
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5967
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5968
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5969
        abbrevs at:classNameSymbol put:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5970
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5971
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5972
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5973
sourceDirectoryNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5974
    "for a given class, return the pathname relative to TOP of the classes source code.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5975
     Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5976
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5977
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5978
     the 3rd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5979
     Return nil if no entry is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5980
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5981
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5982
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5983
    aClassOrClassName isBehavior ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5984
        aClassName := aClassOrClassName name
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5985
    ] ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5986
        aClassName := aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5987
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5988
    aClassName := aClassName asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5989
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5990
    #('include/abbrev.stc' 'include/liblist.stc')    "/ filenames
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5991
    with:#(3 2)                   "/ column
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5992
    do:[:fileName :col |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5993
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5994
        aStream := self systemFileStreamFor:fileName.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5995
        aStream notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5996
            [aStream atEnd] whileFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5997
                line := aStream nextLine.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5998
                line notNil ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  5999
                    (line startsWith:'#') ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6000
                        words := line asCollectionOfWords.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6001
                        (n := words size) > 1 ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6002
                            (words at:1) = aClassName ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6003
                                n >= col ifTrue:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6004
                                    aStream close.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6005
                                    ^ (words at:col) withoutSeparators
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6006
                                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6007
                            ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6008
                        ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6009
                    ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6010
                ]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6011
            ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6012
            aStream close
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6013
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6014
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6015
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6016
    ^ nil
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  6017
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  6018
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6019
     Smalltalk sourceDirectoryNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6020
     Smalltalk sourceDirectoryNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6021
     Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6022
     Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6023
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6024
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6025
    "Created: 6.11.1995 / 15:43:30 / cg"
728
50cf1c907c28 again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  6026
    "Modified: 9.12.1995 / 23:54:14 / cg"
2033
c94698170f36 Close unused streams.
Stefan Vogel <sv@exept.de>
parents: 2029
diff changeset
  6027
    "Modified: 3.1.1997 / 11:26:44 / stefan"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6028
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6029
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6030
sourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6031
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6032
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6033
     Searches in subdirectories named 'source' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6034
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6035
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6036
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6037
    aString := self getSourceFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6038
    aString notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6039
        ^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6040
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6041
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6042
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6043
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6044
systemFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6045
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6046
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6047
     see comment in Smalltalk>>initSystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6048
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6049
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6050
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6051
    aString := self getSystemFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6052
    aString notNil ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6053
        ^ aString asFilename readStreamOrNil
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6054
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6055
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6056
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6057
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6058
systemPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6059
    "return a collection of directorynames, where smalltalk
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6060
     looks for system files 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6061
     (usually in subdirs such as resources, bitmaps, source etc.)
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6062
     see comment in Smalltalk>>initSystemPath."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6063
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6064
    ^ SystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6065
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6066
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6067
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6068
     Smalltalk systemPath addLast:'someOtherDirectoryPath'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6069
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6070
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6071
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6072
systemPath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6073
    "set the collection of directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6074
     looks for system files 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6075
     (usually in subdirs such as resources, bitmaps, source etc.)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6076
     see comment in Smalltalk>>initSystemPath."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6077
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6078
    SystemPath := aPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6079
    self flushPathCaches
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6080
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6081
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6082
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6083
     Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath')
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6084
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6085
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6086
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6087
!Smalltalk class methodsFor:'system management-packages'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6088
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6089
knownPackages
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6090
    ^ KnownPackages ? #()
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6091
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6092
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6093
loadExtensionsForPackage:aPackageId
9600
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6094
    |mgr packageDirName inStream|
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6095
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6096
    "
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6097
     if there is a sourceCodeManager, ask it first for the extensions
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6098
    "
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6099
    (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6100
        inStream := mgr getMostRecentSourceStreamForFile:'extensions.st' inPackage:aPackageId.
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6101
        inStream notNil ifTrue:[
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6102
            Class withoutUpdatingChangeSetDo:[
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6103
                inStream fileIn.
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6104
            ].
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6105
            inStream close.    
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6106
            SilentLoading ifFalse:[
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6107
                Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6108
            ].
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6109
            ^ true
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6110
        ]
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6111
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6112
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6113
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6114
    packageDirName := self getPackageFileName:packageDirName.
9600
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6115
    packageDirName notNil ifTrue:[
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6116
        ^ self loadExtensionsFromDirectory:packageDirName
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6117
    ].
75769f852da0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9598
diff changeset
  6118
    ^ false
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6119
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6120
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6121
loadExtensionsFromDirectory:packageDirOrString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6122
    |packageDir f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6123
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6124
    packageDir := packageDirOrString asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6125
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6126
    f := packageDir construct:'extensions.st'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6127
    f exists ifTrue:[
9523
84319324e99f do not update the changeset, when loading extensions
ca
parents: 9512
diff changeset
  6128
        Class withoutUpdatingChangeSetDo:[
84319324e99f do not update the changeset, when loading extensions
ca
parents: 9512
diff changeset
  6129
            f fileIn.
84319324e99f do not update the changeset, when loading extensions
ca
parents: 9512
diff changeset
  6130
        ].
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6131
        SilentLoading ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6132
            Transcript showCR:('loaded extensions: ' , f pathName).
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6133
        ].
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6134
        ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6135
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6136
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6137
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6138
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6139
loadPackage:aPackageIdOrPackage
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6140
    "make certain, that some particular package is loaded into the system.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6141
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6142
9927
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
  6143
    (aPackageIdOrPackage isSymbol 
a94746219baa class-filename should not be a full path
Claus Gittinger <cg@exept.de>
parents: 9915
diff changeset
  6144
    or:[aPackageIdOrPackage isString]) ifTrue:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6145
        ^ self loadPackageWithId:aPackageIdOrPackage asAutoloaded:false
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6146
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6147
    self shouldImplement.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6148
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6149
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6150
     Smalltalk loadPackage:'stx:libbasic'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6151
     Smalltalk loadPackage:'stx:goodies/persistency'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6152
     Smalltalk loadPackage:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6153
     Smalltalk loadPackage:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6154
    "
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6155
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6156
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6157
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6158
    "load all source files found in aDirectory and treat them like
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6159
     a package. Allows for initial import of alien ST-code as a new package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6160
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6161
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6162
    |p t new anyFail repeatCount|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6163
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6164
    "/ problem: dependencies.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6165
    "/ solution: repeat twice, so that superclasses are present the second time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6166
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6167
    Class packageQuerySignal answer:packageId asSymbol do:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6168
        |any|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6169
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6170
        repeatCount := 0.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6171
        [
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6172
            repeatCount := repeatCount + 1.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6173
            anyFail := false.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6174
            aDirectory directoryContents do:[:file |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6175
                |fn|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6176
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6177
                fn := aDirectory construct:file.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6178
                (fn hasSuffix:'st') ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6179
                    Metaclass confirmationQuerySignal answer:false      
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6180
                    do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6181
                        Error 
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6182
                            handle:[:ex |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6183
                                anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6184
                            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6185
                            do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6186
                                (self fileIn:fn) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6187
                                    anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6188
                                ] ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6189
                                    any := true.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6190
                                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6191
                            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6192
                    ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6193
                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6194
            ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6195
            any ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6196
                ^ false "/ no file found
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6197
            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6198
        ] doWhile:[anyFail and:[repeatCount<2]].
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6199
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6200
                
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6201
    new := (p := Project projectWithId:packageId) isNil.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6202
    new ifTrue:[ p := Project new].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6203
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6204
    p name:packageId.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6205
    p directory:aDirectory.
4726
5c5e1c7f8933 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4724
diff changeset
  6206
    p package:packageId.
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6207
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6208
    p repositoryModule:(t first).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6209
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6210
    p isLoaded:true.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6211
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6212
    new ifTrue:[Project addLoadedProject:p].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6213
    ^ anyFail not
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6214
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6215
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6216
loadPackage:packageId fromClassLibrary:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6217
    "load a package from a compiled classLib.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6218
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6219
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6220
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6221
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6222
    (self fileIn:aFilename) ifFalse:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6223
        (self fileInClassLibrary:aFilename) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6224
            self warn:'Failed to load the package ', packageId printString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6225
            ^ false.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6226
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6227
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6228
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6229
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6230
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6231
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6232
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6233
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6234
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6235
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6236
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6237
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6238
    p isLoaded:true.
4723
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  6239
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  6240
    new ifTrue:[Project addLoadedProject:p].
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  6241
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6242
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6243
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6244
loadPackage:packageId fromLoadAllFile:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6245
    "load a package from a loadAll - loader script.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6246
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6247
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6248
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6249
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6250
    Metaclass confirmationQuerySignal answer:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6251
    do:[
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6252
        (self fileIn:aFilename) ifFalse:[
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6253
            self warn:'Failed to load the package ', packageId printString.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6254
            ^ false.
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6255
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6256
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6257
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6258
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6259
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6260
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6261
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6262
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6263
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6264
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6265
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6266
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6267
    p isLoaded:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6268
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6269
    new ifTrue:[Project addLoadedProject:p].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6270
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6271
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6272
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6273
loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6274
    "load a package from a .prj spec.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6275
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6276
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6277
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6278
    "/ not yet implemented ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6279
    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6280
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6281
"/    |prj fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6282
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6283
"/        prj := Project new loadFromProjectFile:f asFilename pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6284
"/    "/ no - also allow for applications to be loaded this way
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6285
"/    "/    prj type == #library ifFalse:[ ^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6286
"/    self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6287
"/        "/ load all prerequisites ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6288
"/        prj prerequisites do:[:aRequiredPackage |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6289
"/            self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6290
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6291
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6292
"/        "/ see if there is a class library ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6293
"/        fn := prj directory asFilename construct:(prj name , ObjectFileLoader sharedLibraryExtension).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6294
"/        fn exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6295
"/            "/ load that classLibrary ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6296
"/            self fileIn:fn pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6297
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6298
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6299
"/        "/ now, for all other classes, file-them in
5601
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6300
"/        "/ or declare as autoloaded ...
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6301
"/
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6302
"/        prj classes do:[:aClassOrName | |ns|
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6303
"/            aClassOrName isBehavior ifFalse:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6304
"/                ((self includesKey:aClassOrName) not  
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6305
"/                and:[(ns := prj defaultNameSpace) isNil
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6306
"/                    or:[ns == self
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6307
"/                    or:[(ns includesKey:aClassOrName) not]]]) 
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6308
"/                ifTrue:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6309
"/                    "/ must load a corresponding source or cls-file
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6310
"/    self halt.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6311
"/                ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6312
"/            ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6313
"/        ].
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6314
"/        prj isLoaded:true.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6315
"/        prj directory:f asFilename directoryName.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6316
"/        Project addLoadedProject:prj.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  6317
"/        ^ true
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  6318
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  6319
"
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  6320
 Smalltalk loadPackage:'exept:osi/asn1'
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  6321
 Smalltalk 
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6322
        loadPackage:'exept:osi/asn1'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6323
        fromProjectFile:'../../../exept/osi/asn1/asn1.prj'
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6324
        asAutoloaded:false
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  6325
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6326
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6327
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6328
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6329
    "load a package from a .zip delivery file.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6330
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6331
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6332
    "/ not yet implemented ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6333
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6334
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6335
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6336
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6337
    |abbrevFile packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6338
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6339
    packageDir := self packageDirectoryForPackageId:aPackageId.
8380
ec3e8dfc46a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8379
diff changeset
  6340
    packageDir isNil ifTrue:[^ false].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6341
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6342
    "/ abbrev.stc ?
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6343
    abbrevFile := packageDir construct:'abbrev.stc'.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6344
    abbrevFile exists ifFalse:[^ false].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6345
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6346
    Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6347
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6348
    doLoadAsAutoloaded ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6349
        "/ force autoloading...
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  6350
        Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6351
    ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6352
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6353
    self loadExtensionsFromDirectory:packageDir.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6354
    SilentLoading ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6355
        Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6356
    ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6357
    ^ true
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  6358
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  6359
    "Modified: / 10-08-2006 / 12:17:57 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6360
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6361
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6362
loadPackageWithId:aPackageId
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6363
    "make certain, that some particular package is loaded into the system.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6364
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6365
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6366
    ^ self loadPackageWithId:aPackageId asAutoloaded:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6367
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6368
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6369
     Smalltalk loadPackageWithId:'stx:libbasic'  
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6370
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6371
     Smalltalk loadPackageWithId:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6372
     Smalltalk loadPackageWithId:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6373
     Smalltalk loadPackageWithId:'detemobil:smc'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6374
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6375
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6376
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6377
loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6378
    "make certain, that some particular package is loaded into the system.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6379
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6380
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6381
    |pkg packageDir|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6382
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6383
    pkg := Project projectWithId:aPackageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6384
    (pkg notNil and:[pkg isLoaded]) ifTrue:[ 
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6385
        "/ ('Smalltalk [info]: Package ' , aPackageId , ' already loaded.') infoPrintCR.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6386
        (doLoadAsAutoloaded 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6387
        or:[pkg areAllClassesLoaded]) ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6388
            ^ true
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6389
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6390
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6391
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6392
    "/ ok; not yet loaded.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6393
    "/ try to locate the package; try the following:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6394
    "/    $(packagePath)/<packageDir>/...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6395
    "/    $(SYSPATH)/packages/<packageDir>
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6396
    packageDir := self packageDirectoryForPackageId:aPackageId.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6397
    packageDir isNil ifTrue:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6398
        (aPackageId includes:$:) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6399
            "/ assume stx
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6400
            packageDir := self packageDirectoryForPackageId:('stx:',aPackageId).
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6401
        ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6402
    ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6403
    packageDir isNil ifTrue:[
9104
c86073f4e3c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9090
diff changeset
  6404
        ('Smalltalk [warning]: cannot find packageDirectory for: ' , aPackageId) errorPrintCR.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6405
        ^ false
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6406
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6407
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6408
    ^ self
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6409
        loadPackageWithId:aPackageId 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6410
        fromDirectory:packageDir 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6411
        asAutoloaded:doLoadAsAutoloaded
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6412
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6413
    "
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6414
     Smalltalk loadPackageWithId:'stx:libbasic'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6415
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6416
     Smalltalk loadPackageWithId:'exept:ctypes'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6417
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6418
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6419
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6420
loadPackageWithId:aPackageId fromDirectory:packageDirOrString asAutoloaded:doLoadAsAutoloaded
9819
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6421
    |f packageDir packageName shLibName defClass|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6422
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6423
    packageDir := packageDirOrString asFilename.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6424
    packageName := packageDir baseName.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6425
9819
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6426
    "/ if there is a project definiton, use that one to pull in the rest.
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6427
    defClass := ProjectDefinition definitionClassForPackage:aPackageId.
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6428
    defClass notNil ifTrue:[
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6429
        defClass autoload.
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6430
        defClass load.
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6431
        ^ self.
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6432
    ].
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6433
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6434
    "/ .prj ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6435
    f := (packageDir construct:packageName) withSuffix:'prj'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6436
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6437
        (self loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6438
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6439
                Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageId , ' from project file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6440
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6441
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6442
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6443
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6444
    "/ loadAll ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6445
    f := packageDir construct:'loadAll'.
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6446
    f exists ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6447
        f := packageDir construct:'loadall'.
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6448
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6449
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6450
        (self loadPackage:aPackageId fromLoadAllFile:f) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6451
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6452
                Transcript showCR:('loaded package: ' , aPackageId , ' from loadAll file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6453
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6454
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6455
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6456
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6457
    "/ .zip ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6458
    f := (packageDir construct:packageName) withSuffix:'zip'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6459
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6460
        (self loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6461
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6462
                Transcript showCR:('loaded package: ' , aPackageId , ' from zip file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6463
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6464
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6465
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6466
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6467
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6468
    shLibName := packageName , ObjectFileLoader sharedLibraryExtension.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6469
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6470
    "/ .so ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6471
    f := packageDir construct:shLibName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6472
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6473
        (self loadPackage:aPackageId fromClassLibrary:f) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6474
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6475
                Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6476
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6477
            doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6478
                "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6479
                Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6480
                    eachClass package == aPackageId ifTrue:[ eachClass autoload].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6481
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6482
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6483
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6484
        ]              
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6485
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6486
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6487
    "/ abbrev.stc ?
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6488
    (self loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded) ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6489
        ^ true
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6490
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6491
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6492
    "/ any .so ?  -> load the first one found (maybe not a good idea)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6493
    packageDir directoryContentsAsFilenamesDo:[:aFilename |
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6494
        (aFilename hasSuffix:ObjectFileLoader sharedLibrarySuffix) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6495
            (self loadPackage:aPackageId fromClassLibrary:aFilename) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6496
                SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6497
                    Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , aFilename pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6498
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6499
                doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6500
                    "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6501
                    Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6502
                        eachClass package == aPackageId ifTrue:[ eachClass autoload].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6503
                    ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6504
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6505
                ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6506
            ]
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6507
        ]
5175
c3e71ead8e06 when loading a package, and a .so file could not be found
Claus Gittinger <cg@exept.de>
parents: 5168
diff changeset
  6508
    ].
5807
019d25b669e5 in loadPackage, if there is no loadAll file and no
Claus Gittinger <cg@exept.de>
parents: 5789
diff changeset
  6509
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6510
    "/ source files
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6511
    (self loadPackage:aPackageId fromAllSourceFilesInDirectory:packageDir) ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6512
        SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6513
            Transcript showCR:('loaded package: ' , aPackageId , ' from source files in:' , packageDir pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6514
        ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6515
        ^ true
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6516
    ].
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6517
    ^ false
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6518
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6519
    "
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6520
     Smalltalk loadPackageWithId:'stx:libbasic'  
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6521
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
4722
854b7a5427b0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4720
diff changeset
  6522
     Smalltalk loadPackageWithId:'exept:ctypes'
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6523
    "
9819
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6524
39b29e0666bf load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents: 9805
diff changeset
  6525
    "Modified: / 30-08-2006 / 18:29:20 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6526
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6527
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6528
packageDirectoryForPackageId:aPackageId
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6529
    |packageDirName packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6530
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6531
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6532
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6533
    packageDir := self getPackageFileName:packageDirName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6534
    packageDir isNil ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6535
        "/ for convenience: try ../../.. as well 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6536
        "/ (when executing in thedevelopment environment)
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6537
        packageDir := '../../..' asFilename construct:packageDirName.
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6538
        packageDir exists ifFalse:[ ^ nil].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6539
    ].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6540
    ^ packageDir asFilename
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6541
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6542
    "
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6543
     Smalltalk packageDirectoryForPackageId:'stx:libbasic'  
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6544
     Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6545
     Smalltalk packageDirectoryForPackageId:'exept:ctypes'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6546
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6547
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6548
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6549
!Smalltalk class methodsFor:'system management-undeclared variables'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6550
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6551
clearUndeclaredVariables
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6552
    "remove all undeclared variables"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6553
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6554
    (Smalltalk at:#Undeclared) do:[:eachKey |
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6555
        Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6556
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6557
    (Smalltalk at:#Undeclared) removeAll.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6558
    Smalltalk removeKey:#Undeclared.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6559
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6560
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6561
undeclaredPrefix
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6562
    "the prefix used for undeclared variables"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6564
    ^ 'Undeclared:::'
6711
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6565
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6566
    "Created: / 31.10.1997 / 01:13:10 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6567
! !
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6568
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6569
!Smalltalk class methodsFor:'time-versions'!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6570
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6571
configuration
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6572
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6573
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6574
    "for developers only: return the configuration, with which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6575
     this smalltalk was compiled."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6576
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6577
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6578
    extern char *__getConfigurationString();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6579
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6580
    RETURN (__MKSTRING(__getConfigurationString() COMMA_SND));
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6581
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6582
    ^ 'unknownOS/unknownCONF:unknownPACK'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6584
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6585
     Smalltalk configuration 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6586
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6587
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6588
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6589
copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6590
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6591
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6592
    "return a copyright string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6593
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6594
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6595
#ifndef __getCopyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6596
    extern OBJ __getCopyrightString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6597
#endif
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6598
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6599
    RETURN (__getCopyrightString());
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6600
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6601
    ^ self primitiveFailed
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6602
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6603
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6604
     Smalltalk copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6605
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6606
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6607
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6608
distributorString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6609
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6610
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6611
    "return a string describing the distributor of this software"
567
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6612
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6613
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6614
#ifndef __getDistributorString
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6615
    extern OBJ __getDistributorString();
568
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6616
#endif
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6617
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6618
    RETURN (__getDistributorString());
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6619
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6620
    ^ 'eXept Software AG, Germany'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6621
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6622
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6623
     Smalltalk distributorString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6624
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6625
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6626
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6627
expirationTime
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6628
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6629
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6630
    "for developers only: return the time when the system will expire.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6631
     after this time it will not run any longer.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6632
     It returns nil, if no expiration time has been set (system runs forever :-))"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6633
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6634
    |exp|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6635
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6636
%{  
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6637
    extern unsigned int __getExpirationTime();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6638
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6639
    exp = __MKUINT(__getExpirationTime());
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6640
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6641
    exp == 0 ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6642
        ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6643
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6644
    ^ Timestamp new fromOSTime:(exp * 1000). "OSTime is ms since 1970"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6645
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6646
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6647
     Smalltalk expirationTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6648
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6649
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6650
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6651
fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6652
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6653
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6654
    "return a full version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6655
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6656
    ^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6657
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6658
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6659
     Smalltalk fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6660
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6661
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6662
    "Created: / 27.10.1997 / 17:03:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6663
    "Modified: / 27.10.1997 / 17:04:02 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6664
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6665
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6666
hello
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6667
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6668
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6669
    "return a greeting string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6670
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6671
    "stupid: this should come from a resource file ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6672
     but I dont use it here, to allow mini-systems without
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6673
     Resource-stuff."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6674
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6675
    |proto lang|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6676
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6677
    lang := Language.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6678
    (lang == #de) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6679
        proto := 'Willkommen bei %1 (Version %2 von %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6680
    ] ifFalse:[ (lang == #fr) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6681
        proto := 'Salut, Bienvenue à %1 (version %2 de %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6682
    ] ifFalse:[ (lang == #it) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6683
        proto := 'Ciao, benvenuto al %1 (versione %2 di %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6684
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6685
"/        proto := 'Hola, bienvenida a %1 (versión %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6686
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6687
"/        proto := 'Oi, benvindo a %1 (versão %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6688
    ] ifFalse:[ (lang == #no) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6689
        proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6690
    ]]]]]].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6691
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6692
    "/ ... more needed here ...
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6693
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6694
    proto isNil ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6695
        proto := 'Hello World - here is %1 version %2 of %3'.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6696
    ].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6697
6187
d4788adb7a8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6186
diff changeset
  6698
    ^ proto bindWith:('SmallTalk/X' allBold)
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6699
                with:(self versionString) 
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6700
                with:(self versionDate)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6701
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6702
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6703
     Smalltalk language:#us.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6704
     Smalltalk hello     
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6705
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6706
     Smalltalk language:#de.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6707
     Smalltalk hello  
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6708
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6709
     Smalltalk language:#no.   
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6710
     Smalltalk hello  
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6711
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6712
     Transcript showCR:(Smalltalk hello)
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6713
     Stdout showCR:(Smalltalk hello)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6714
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6715
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6716
    "Modified: 18.5.1996 / 14:25:13 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6717
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6718
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6719
imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6720
    "return a timestamp for the moment when this image was restarted.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6721
     If we do not execute from an image (i.e. fresh start), return nil."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6722
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6723
    ^ ImageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6724
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6725
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6726
     Smalltalk imageStartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6727
     Smalltalk imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6728
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6729
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6730
    "Created: 13.12.1995 / 17:44:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6731
    "Modified: 6.3.1996 / 11:56:35 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6732
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6733
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6734
imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6735
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6736
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6737
    "return a timestamp for the moment when this image was saved"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6738
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6739
    ^ ObjectMemory imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6740
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6741
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6742
imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6743
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6744
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6745
    "return a timestamp for the moment when this system started the first time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6746
     (i.e. the first initial start without an image)"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6747
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6748
    ^ ImageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6749
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6750
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6751
     Smalltalk imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6752
     Smalltalk imageRestartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6753
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6754
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6755
    "Created: 13.12.1995 / 17:44:14 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6756
    "Modified: 13.12.1995 / 17:45:47 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6757
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6759
majorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6760
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6761
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6762
    "return the major version number.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6763
     This is only incremented for very fundamental changes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6764
     which make old object files totally incompatible
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6765
     (for example, if the layout/representation of fundamental
3382
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6766
      classes changes).
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6767
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6768
     ST/X revision Naming is:
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  6769
        <major>.<minor>.<revision>.<release>"
7362
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6770
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6771
    ^ 5
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6772
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6773
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6774
     Smalltalk majorVersionNr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6775
    "
1941
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6776
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6777
    "Modified: 8.11.1996 / 19:59:21 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6778
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6779
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6780
minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6781
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6782
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6783
    "return the minor version number.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6784
     This is incremented for changes which make some old object
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6785
     files incompatible, or the protocol changes such that some
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6786
     classes need rework.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6787
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6788
     ST/X revision Naming is:
7981
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6789
        <major>.<minor>.<revision>.<release>"
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6790
9531
73b1aa294395 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9523
diff changeset
  6791
    ^ 3
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6792
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6793
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6794
     Smalltalk minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6795
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6796
9531
73b1aa294395 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9523
diff changeset
  6797
    "Modified: / 16-08-2006 / 09:37:25 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6798
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6799
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6800
releaseIdentification
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6801
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6802
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6803
    "for developers only: return the release 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6804
     (to further identify the version in case of errors)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6805
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6806
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6807
    extern OBJ __getRel();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6808
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6809
    RETURN (__getRel());
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6810
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6811
    ^ 'ST/X_experimental'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6812
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6813
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6814
     Smalltalk releaseIdentification
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6815
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6816
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6817
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6818
releaseNr
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6819
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6820
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6821
    "return the revision number.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6822
     Incremented for releases which fix bugs/add features but did not find
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6823
     their way to the outside world.
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6824
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6825
     ST/X revision Naming is:
8663
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6826
        <major>.<minor>.<revision>.<release>"
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6827
8960
01a030e0ca74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8959
diff changeset
  6828
    ^ 1
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6829
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6830
    " 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6831
     Smalltalk releaseNr 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6832
    "
732
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6833
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6834
    "Created: 10.12.1995 / 01:42:19 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6835
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6836
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6837
revisionNr
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6838
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6839
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6840
    "return the revision number.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6841
     Incremented for releases which fix bugs/add features
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6842
     and represent a stable workable version which got published
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6843
     to the outside world.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6844
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6845
     ST/X revision Naming is:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6846
        <major>.<minor>.<revision>.<release>"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6847
9531
73b1aa294395 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9523
diff changeset
  6848
    ^ 1
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6849
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6850
    " 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6851
     Smalltalk revisionNr
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6852
     Smalltalk hello        
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6853
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6854
9531
73b1aa294395 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9523
diff changeset
  6855
    "Modified: / 16-08-2006 / 09:37:29 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6856
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6857
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6858
timeStamp
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6859
    "return a string useful for timestamping a file.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6860
     The returned string is padded with spaces for a constant
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6861
     length (to avoid changing a files size in fileOut with unchanged
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6862
     class)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6863
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6864
    ^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6865
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6866
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6867
timeStamp:aStream
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6868
    "write a string useful for timestamping a file onto aStream.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6869
     ST80 compatibility"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6870
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6871
    aStream nextPutAll:(self timeStamp).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6872
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6873
    "Created: / 18.6.1998 / 17:22:58 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6874
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6875
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6876
timeStampString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6877
    "return a string useful for timestamping a file."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6878
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6879
    |dateString|
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6880
8115
338205d54c48 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8084
diff changeset
  6881
    dateString := String streamContents:[:s | Date today printOn:s language:#en].  "/ MUST be english !!!!
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6882
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6883
    ^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on '
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6884
       , dateString , ' at ' , Time now printString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6885
       )
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6886
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6887
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6888
versionDate
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6889
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6890
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6891
    "return the executables build date - thats the date when the smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6892
     executable was built"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6893
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6894
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6895
    extern char *__getBuildDateString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6896
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6897
    RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) );
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6898
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6899
    ^ 'today'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6900
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6901
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6902
     Smalltalk versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6903
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6904
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6905
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6906
versionString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6907
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6908
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6909
    "return the version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6910
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6911
    ^ (self majorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6912
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6913
       self minorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6914
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6915
       self revisionNr printString)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6916
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6917
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6918
     Smalltalk versionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6919
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6920
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6921
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6922
vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6923
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6924
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6925
    "return the VMs major version number."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6926
%{
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8880
diff changeset
  6927
    RETURN (__mkSmallInteger(4));
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6928
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6929
    ^ 4
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6930
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6931
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6932
     Smalltalk vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6933
    "
2
claus
parents: 1
diff changeset
  6934
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6935
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  6936
!Smalltalk class methodsFor:'documentation'!
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6937
1568
2ed24cca3dac oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents: 1567
diff changeset
  6938
version
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  6939
    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.757 2006-10-06 09:49:43 cg Exp $'
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6940
! !