|
|
Class: StandaloneStartup
Object
|
+--StandaloneStartup
|
+--WebServerStartup
- Package:
- stx:libbasic
- Category:
- System-Support
- Version:
- rev:
1.41
date: 2009/12/18 10:15:16
- user: cg
- file: StandaloneStartup.st directory: libbasic
- module: stx stc-classLibrary: libbasic
- Author:
- Claus Gittinger
a subclassable template class for a standalone GUI-application's startup;
For your own stand alone programs, define a subclass of this,
and redefine the #main: method there.
(of course, the other methods can also be redefined.)
Smalltalk
GetOpt
ReadEvalPrintLoop
defaults
-
allowDebugOption
-
enable/disable the --debug startup option.
The default is now false, so standAlone apps are closed by default.
Can be redefined in subclasses to enable it
-
allowScriptingOption
-
enable/disable the --scripting startup option.
The default is now false, so standAlone apps are closed by default.
Can be redefined in subclasses to enable it
-
suppressRCFileReading
-
enable/disable the rc-file reading (and also the --rcFileName option).
If suppressed, there is no chance to interfere with the startup.
Can be redefined in subclasses to disable it
helpers
-
printInfo: msg
-
-
redirectStandardStreams
-
-
verboseInfo: msg
-
initialization
-
initialize
-
Verbose := true.
multiple applications support
-
applicationRegistryPath
-
the key under which this application stores its process ID in the registry
as a collection of path-components.
i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
(would also be used as a relative path for a temporary lock file under unix).
Used to detect if another instance of this application is already running.
** This method raises an error - it must be redefined in concrete classes **
-
applicationUUID
-
answer an application-specific unique uuid.
This is used as the name of some exclusive OS-resource, which is used to find out,
if another instance of this application is already running.
Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used.
** This method raises an error - it must be redefined in concrete classes **
-
checkForAndExitIfAnotherApplicationInstanceIsRunning
-
if another instance of this application is running,
send it an openFile command for my file-argument, and exit.
(i.e. to let the already running application open up another window).
multiple applications support-helpers
-
applicationRegistryEntry
-
retrieve the registry entry in which (if present), any currently running application
has left its process ID
-
confirmOpenNewApplicationInstance
-
-
currentIDKeyInRegistry
-
-
getCurrentIDFromRegistry
-
-
getIDOfRunningApplicationFromRegistryEntry
-
-
isAnotherApplicationInstanceRunning
-
answer true, if another instance of mzself is currently running.
For now, it only works under win32, because it uses the underlying mutex mechanism.
-
processStartupOfASecondInstance
-
This is executed when I have been started as a second instance of an already running application.
If I can get the currentID (i.e. windowID) of the first one and there is a command line argument with a file,
send a message to the main window of the already running application, o ask it for another window.
If the currentID is unknown, ask if the user wants to open a new instance of the application anyway.
Return true if the first instance has been notified, and this second instance should exit.
-
releaseApplicationMutex
-
-
sendCommand: message toWindowId: aWindowId
-
use the event send mechanism to forward a command to the already running application
-
sendOpenPathCommand: pathName toWindowId: aWindowId
-
use the event send mechanism to forward an open-Path command to the already running application
-
writeCurrentIDIntoRegistry: currentID
-
queries
-
applicationName
-
used in verbose messages - can/should be redefined in subclasses
-
iconInBrowserSymbol
-
-
isBrowserStartable
-
do not allow clicking on me in the browser
-
keepSplashWindowOpen
-
if true is returned here, the splashWindow is not closed and will be still open
when the main: method is invoked. This allows for plugin-loads etc. to be shown in the
splash screen. However, my subclass's main: has to make sure that the splashScreen is closed.
(calling hideSplashWindow)
The default is false here which means that the splashWindow will be already closed when the
subclasses main: is invoked.
-
startupFilename
-
used in verbose messages - can/should be redefined in subclasses
startup
-
loadPatch: fileName
-
-
loadPatches
-
-
setupSmalltalkFromArguments: argv
-
handle common command line arguments:
--help ............... print usage and exit
--verbose (-V) ....... be verbose during startup
--debug .............. enable debugger & inspector
--rcFileName ......... define a startup rc-file
--scripting portNr ... start a scripting server
--allowHost host ..... add host to the allowed scripting hosts
-
setupToolsForDebug
-
-
setupToolsForNoDebug
-
-
start
-
-
startStartBlockProcess
-
-
usage
-
startup-to be redefined
-
isHeadless
-
this is invoked early by Smalltalk>>mainStartup, to ask if I like to
have a Display or if I am a non-GUI headless application.
Redefine in subclass, if your application is a non-GUI application
-
main
-
-
main: argv
-
** This method raises an error - it must be redefined in concrete classes **
<yourNamehere>Startup start
|