30#if defined(G4UI_BUILD_QT_SESSION)
35#if defined(G4UI_BUILD_XM_SESSION)
39#if defined(G4UI_BUILD_WIN32_SESSION)
51#if defined(G4UI_BUILD_QT_SESSION)
57#if defined(G4UI_BUILD_XM_SESSION)
63#if defined(G4UI_BUILD_WIN32_SESSION)
75#define DISCARD_PARAMETER(p) (void)p
79 : selected(
kNone),
session(NULL), shell(NULL), isGUI(false), verbose(true)
82 G4cout <<
"Available UI session types: [ ";
102 size_t islash = appinput.find_last_of(
"/\\");
103 if (islash == G4String::npos)
106 appname = appinput.substr(islash+1, appinput.size()-islash-1);
117#if defined(G4UI_BUILD_QT_SESSION)
123#if defined(G4UI_BUILD_XM_SESSION)
129#if defined(G4UI_BUILD_WIN32_SESSION)
158 "Specified session type is not build in your system,\n"
159 "or no session type is specified.\n"
160 "A fallback session type is used.");
200 const char* path = std::getenv(
"HOME");
201 if( path == NULL )
return;
210 std::ifstream fsession;
213 fsession.open(
fname, std::ios::in);
218 while( fsession.good() ) {
219 if( fsession.eof())
break;
220 fsession.getline(linebuf,
BUFSIZE);
222 if ( aline[0] ==
'#' )
continue;
223 if ( aline ==
"" )
continue;
225 default_session = aline;
227 size_t idx = aline.find_first_of(
" ");
228 if ( idx == G4String::npos )
break;
229 G4String aname = aline.substr(0, idx);
230 idx = aline.find_first_not_of(
" ", idx);
231 if (idx == G4String::npos )
break;
232 G4String sname = aline.substr(idx, aline.size()-idx);
240 std::map<G4String, G4String>::iterator it =
sessionMap.find(appname);
242 else stype = default_session;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define TIMEMORY_INIT(...)
static const G4bool win32_build
#define DISCARD_PARAMETER(p)
static const G4bool qt_build
static const G4bool tcsh_build
static const G4bool xm_build
G4GLOB_DLL std::ostream G4cout
void SetPrompt(const G4String &prompt)
void SelectSessionByFile(const G4String &appname)
void SelectSessionByBestGuess()
void SelectSessionByArg(const G4String &stype)
G4UIExecutive(G4int argc, char **argv, const G4String &type="")
void SelectSessionByEnv()
std::map< G4String, G4String > sessionMap
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor)
G4String to_lower_copy(G4String str)
Return lowercased copy of string.
G4String strip_copy(G4String str, char c=' ')
Return copy of string with leading and trailing characters removed.
void to_lower(G4String &str)
Convert string to lowercase.