32 #if defined(G4UI_BUILD_QT_SESSION)
37 #if defined(G4UI_BUILD_WT_SESSION)
42 #if defined(G4UI_BUILD_XM_SESSION)
46 #if defined(G4UI_BUILD_WIN32_SESSION)
58 #if defined(G4UI_BUILD_QT_SESSION)
64 #if defined(G4UI_BUILD_XM_SESSION)
70 #if defined(G4UI_BUILD_WIN32_SESSION)
76 #if defined(G4UI_BUILD_WT_SESSION)
88 #define DISCARD_PARAMETER(p) (void)p
92 : selected(
kNone),
session(NULL), shell(NULL), isGUI(false)
94 G4cout <<
"Available UI session types: [ ";
116 size_t islash = appinput.find_last_of(
"/\\");
117 if (islash == G4String::npos)
120 appname = appinput(islash+1, appinput.size()-islash-1);
131 #if defined(G4UI_BUILD_QT_SESSION)
132 session =
new G4UIQt(argc, argv);
137 #if defined(G4UI_BUILD_XM_SESSION)
138 session =
new G4UIXm(argc, argv);
143 #if defined(G4UI_BUILD_WIN32_SESSION)
150 #if defined(G4UI_BUILD_WT_SESSION)
151 session =
new G4UIWt(argc, argv);
183 "Specified session type is not build in your system,\n"
184 "or no session type is specified.\n"
185 "A fallback session type is used.");
227 const char* path = getenv(
"HOME");
228 if( path == NULL )
return;
232 G4String fname= homedir +
"/.g4session";
234 G4String fname= homedir +
"\\.g4session";
237 std::ifstream fsession;
238 enum { BUFSIZE= 1024 };
char linebuf[BUFSIZE];
245 while( fsession.good() ) {
246 if( fsession.eof())
break;
247 fsession.getline(linebuf, BUFSIZE);
250 if ( aline(0) ==
'#' )
continue;
252 default_session = aline;
254 size_t idx = aline.find_first_of(
" ");
255 if ( idx == G4String::npos )
break;
256 G4String aname = aline.substr(0, idx);
257 idx = aline.find_first_not_of(
" ", idx);
258 if (idx == G4String::npos )
break;
259 G4String sname = aline.substr(idx, aline.size()-idx);
267 std::map<G4String, G4String>::iterator it =
sessionMap.find(appname);
269 else stype = default_session;
static const G4bool xm_build
static G4UIterminal * session
static const G4bool win32_build
#define DISCARD_PARAMETER(p)
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor)
static const G4bool wt_build
void SelectSessionByBestGuess()
static const G4bool qt_build
void SelectSessionByEnv()
std::map< G4String, G4String > sessionMap
static const G4bool tcsh_build
G4String strip(G4int strip_Type=trailing, char c=' ')
G4UIExecutive(G4int argc, char **argv, const G4String &type="")
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetPrompt(const G4String &prompt)
G4GLOB_DLL std::ostream G4cout
void SelectSessionByFile(const G4String &appname)
void SelectSessionByArg(const G4String &stype)