Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIArrayString.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
#include "G4Qt.hh"
|
||||
#endif
|
||||
|
||||
#if defined(G4UI_BUILD_WT_SESSION)
|
||||
#include "G4UIWt.hh"
|
||||
#include "G4Wt.hh"
|
||||
#endif
|
||||
|
||||
#if defined(G4UI_BUILD_XM_SESSION)
|
||||
#include "G4UIXm.hh"
|
||||
#endif
|
||||
@@ -42,10 +47,6 @@
|
||||
#include "G4UIWin32.hh"
|
||||
#endif
|
||||
|
||||
#if defined(G4UI_BUILD_WT_SESSION)
|
||||
//#include "G4UIWt.hh"
|
||||
#endif
|
||||
|
||||
#include "G4UIGAG.hh"
|
||||
#include "G4UIterminal.hh"
|
||||
#include "G4UItcsh.hh"
|
||||
@@ -147,8 +148,8 @@ G4UIExecutive::G4UIExecutive(G4int argc, char** argv, const G4String& type)
|
||||
break;
|
||||
case kWt:
|
||||
#if defined(G4UI_BUILD_WT_SESSION)
|
||||
//session = new G4UIWt(argc, argv);
|
||||
//isGUI = true;
|
||||
session = new G4UIWt(argc, argv);
|
||||
isGUI = true;
|
||||
#endif
|
||||
break;
|
||||
case kGag:
|
||||
@@ -203,7 +204,7 @@ void G4UIExecutive::SelectSessionByArg(const G4String& stype)
|
||||
if ( qt_build && stype == "qt" ) selected = kQt;
|
||||
else if ( xm_build && stype == "xm" ) selected = kXm;
|
||||
else if ( win32_build && stype == "win32" ) selected = kWin32;
|
||||
//else if ( wt_build && stype == "wt" ) selected = kWt;
|
||||
else if ( wt_build && stype == "wt" ) selected = kWt;
|
||||
else if ( stype == "gag" ) selected = kGag;
|
||||
else if ( tcsh_build && stype == "tcsh" ) selected = kTcsh;
|
||||
else if ( stype == "csh" ) selected = kCsh;
|
||||
@@ -215,7 +216,7 @@ void G4UIExecutive::SelectSessionByEnv()
|
||||
if ( qt_build && getenv("G4UI_USE_QT") ) selected = kQt;
|
||||
else if ( xm_build && getenv("G4UI_USE_XM") ) selected = kXm;
|
||||
else if ( win32_build && getenv("G4UI_USE_WIN32") ) selected = kWin32;
|
||||
//else if ( wt_build && getenv("G4UI_USE_WT") ) selected = kWt;
|
||||
else if ( wt_build && getenv("G4UI_USE_WT") ) selected = kWt;
|
||||
else if ( getenv("G4UI_USE_GAG") ) selected = kGag;
|
||||
else if ( tcsh_build && getenv("G4UI_USE_TCSH") ) selected = kTcsh;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIWin32.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,257 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
#ifdef G4UI_BUILD_XAW_SESSION
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/StringDefs.h>
|
||||
#include <X11/Shell.h>
|
||||
|
||||
#include <Xaw/Dialog.h>
|
||||
#include <Xaw/Command.h>
|
||||
|
||||
#include "G4UIXaw.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4UIcommandTree.hh"
|
||||
#include "G4UIcommandStatus.hh"
|
||||
#include "G4Xt.hh"
|
||||
|
||||
static G4bool ConvertStringToInt(const char*,int&);
|
||||
|
||||
static G4bool exitSession = true;
|
||||
static G4bool exitPause = true;
|
||||
static G4bool exitHelp = true;
|
||||
/***************************************************************************/
|
||||
G4UIXaw::G4UIXaw (
|
||||
int argc
|
||||
,char** argv
|
||||
)
|
||||
:fHelp(false)
|
||||
,fHelpChoice(0)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
G4cout <<
|
||||
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
"\n!!!!! Xaw is deprecated and will be removed in the next major release."
|
||||
"\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
if(UI!=NULL) UI->SetSession(this);
|
||||
|
||||
G4Xt* interactorManager = G4Xt::getInstance (argc,argv,(char*)"Xaw");
|
||||
Widget top = (Widget)interactorManager->GetMainInteractor();
|
||||
|
||||
shell = XtAppCreateShell ("G4UIXaw","G4UIXaw",topLevelShellWidgetClass,XtDisplay(top),NULL,0);
|
||||
|
||||
Arg args[2];
|
||||
XtSetArg (args[0],XtNlabel,"G4 command");
|
||||
XtSetArg (args[1],XtNvalue,""); // Needed to have a text Area.
|
||||
dialog = XtCreateManagedWidget ("dialog",dialogWidgetClass,shell,args,2);
|
||||
|
||||
XawDialogAddButton (dialog,"Ok",Callback,(XtPointer)this);
|
||||
|
||||
XtRealizeWidget (shell);
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4UIXaw::~G4UIXaw (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
XtDestroyWidget (shell);
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
if(UI!=NULL) UI->SetSession(NULL);
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4UIsession* G4UIXaw::SessionStart (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4Xt* interactorManager = G4Xt::getInstance ();
|
||||
Prompt ("session");
|
||||
exitSession = false;
|
||||
interactorManager->DisableSecondaryLoop ();
|
||||
void* event;
|
||||
while((event = interactorManager->GetEvent())!=NULL) {
|
||||
interactorManager->DispatchEvent(event);
|
||||
if(exitSession==true) break;
|
||||
}
|
||||
interactorManager->EnableSecondaryLoop ();
|
||||
return this;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::Prompt (
|
||||
const G4String& aPrompt
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
Arg args[1];
|
||||
XtSetArg (args[0],XtNlabel,aPrompt.data());
|
||||
XtSetValues (dialog,args,1);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::SessionTerminate (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::PauseSessionStart (
|
||||
const G4String& a_state
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(a_state=="G4_pause> ") {
|
||||
SecondaryLoop ("Pause, type continue to exit this state");
|
||||
}
|
||||
|
||||
if(a_state=="EndOfEvent") {
|
||||
// Picking with feed back in event data Done here !!!
|
||||
SecondaryLoop ("End of event, type continue to exit this state");
|
||||
}
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::SecondaryLoop (
|
||||
G4String a_prompt
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4Xt* interactorManager = G4Xt::getInstance ();
|
||||
Prompt (a_prompt);
|
||||
exitPause = false;
|
||||
void* event;
|
||||
while((event = interactorManager->GetEvent())!=NULL) {
|
||||
interactorManager->DispatchEvent(event);
|
||||
if(exitPause==true) break;
|
||||
}
|
||||
Prompt ("session");
|
||||
}
|
||||
/***************************************************************************/
|
||||
Widget G4UIXaw::GetDialog (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
return dialog;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4bool G4UIXaw::GetHelpChoice(
|
||||
G4int& aInt
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
fHelp = true;
|
||||
//
|
||||
G4Xt* interactorManager = G4Xt::getInstance ();
|
||||
Prompt("Help");
|
||||
exitHelp = false;
|
||||
void* event;
|
||||
while((event = interactorManager->GetEvent())!=NULL) {
|
||||
interactorManager->DispatchEvent(event);
|
||||
if(exitHelp==true) break;
|
||||
}
|
||||
Prompt("session");
|
||||
//
|
||||
if(fHelp==false) return false;
|
||||
aInt = fHelpChoice;
|
||||
fHelp = false;
|
||||
return true;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::ExitHelp(
|
||||
) const
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
void G4UIXaw::Callback (
|
||||
Widget
|
||||
,XtPointer a_tag
|
||||
,XtPointer
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4UIXaw* This = (G4UIXaw*)a_tag;
|
||||
Widget dialog = This->GetDialog();
|
||||
char* value = XawDialogGetValueString(dialog);
|
||||
if(value==NULL) return;
|
||||
G4String command (value);
|
||||
|
||||
if(This->fHelp==true) {
|
||||
exitHelp = true;
|
||||
This->fHelp = ConvertStringToInt(command.data(),This->fHelpChoice);
|
||||
} else {
|
||||
This->ApplyShellCommand (command,exitSession,exitPause);
|
||||
}
|
||||
|
||||
Arg args[1];
|
||||
XtSetArg (args[0],XtNvalue,"");
|
||||
XtSetValues (dialog,args,1);
|
||||
|
||||
//a_widget = NULL; Not used (1st argument). Comment out to avoid compiler warnings. (JA)
|
||||
//a_data = NULL; Not used (3rd argument). Comment out to avoid compiler warnings. (JA)
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
G4bool ConvertStringToInt(
|
||||
const char* aString
|
||||
,int& aInt
|
||||
)
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
|
||||
{
|
||||
aInt = 0;
|
||||
if(aString==NULL) return false;
|
||||
char* s;
|
||||
long value = strtol(aString,&s,10);
|
||||
if(s==aString) return false;
|
||||
aInt = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIXm.cc 74547 2013-10-14 12:51:17Z gcosmo $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
@@ -423,7 +423,6 @@ void G4UIXm::ButtonCallback (
|
||||
G4UIXm* This = (G4UIXm*)a_tag;
|
||||
if(This->fHelp==true) return; // Disabled when in help.
|
||||
G4String ss = This->GetCommand (a_widget);
|
||||
//printf ("debug : execute:\n%s\n",ss.data());
|
||||
This->ApplyShellCommand(ss,exitSession,exitPause);
|
||||
}
|
||||
/***************************************************************************/
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIcsh.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#include "G4UIcsh.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UItcsh.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4UIterminal.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
// ====================================================================
|
||||
// G4UIterminal.cc
|
||||
@@ -47,7 +47,7 @@
|
||||
// signal handler for soft-abort
|
||||
// ====================================================================
|
||||
|
||||
static G4VUIshell* theshell= 0;
|
||||
static G4ThreadLocal G4VUIshell* theshell= 0;
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4VUIshell.cc 66892 2013-01-17 10:57:59Z gunter $
|
||||
//
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
Reference in New Issue
Block a user