30 #if defined(G4UI_BUILD_QT_SESSION)
35 #if defined(G4UI_BUILD_WT_SESSION)
40 #if defined(G4UI_BUILD_XM_SESSION)
44 #if defined(G4UI_BUILD_WIN32_SESSION)
57 #if defined(G4UI_BUILD_QT_SESSION)
63 #if defined(G4UI_BUILD_XM_SESSION)
69 #if defined(G4UI_BUILD_WIN32_SESSION)
75 #if defined(G4UI_BUILD_WT_SESSION)
87 #define DISCARD_PARAMETER(p) (void)p
91 : selected(kNone),
session(NULL), shell(NULL), isGUI(
false)
93 G4cout <<
"Available UI session types: [ ";
115 size_t islash = appinput.find_last_of(
"/\\");
116 if (islash == G4String::npos)
119 appname = appinput(islash+1, appinput.size()-islash-1);
130 #if defined(G4UI_BUILD_QT_SESSION)
131 session =
new G4UIQt(argc, argv);
136 #if defined(G4UI_BUILD_XM_SESSION)
137 session =
new G4UIXm(argc, argv);
142 #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.");
222 else if ( std::getenv(
"G4UI_USE_GAG") )
selected =
kGag;
229 const char* path = std::getenv(
"HOME");
230 if( path == NULL )
return;
236 G4String fname= homedir +
"\\.g4session";
239 std::ifstream fsession;
247 while( fsession.good() ) {
248 if( fsession.eof())
break;
249 fsession.getline(linebuf,
BUFSIZE);
252 if ( aline(0) ==
'#' )
continue;
253 if ( aline ==
"" )
continue;
255 default_session = aline;
257 size_t idx = aline.find_first_of(
" ");
258 if ( idx == G4String::npos )
break;
259 G4String aname = aline.substr(0, idx);
260 idx = aline.find_first_not_of(
" ", idx);
261 if (idx == G4String::npos )
break;
262 G4String sname = aline.substr(idx, aline.size()-
idx);
270 std::map<G4String, G4String>::iterator
it =
sessionMap.find(appname);
272 else stype = default_session;