// // ******************************************************************** // * 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: G4UIExecutive.icc,v 1.7 2010/05/28 08:12:27 kmura Exp $ // GEANT4 tag $Name: $ // // ==================================================================== // G4UIExecutive.icc // // ==================================================================== #include "G4UIsession.hh" #include "G4UImanager.hh" #if defined(G4UI_USE_QT) #include "G4UIQt.hh" #include "G4Qt.hh" #elif defined(G4UI_USE_XM) #include "G4UIXm.hh" #elif defined(G4UI_USE_WIN32) #include "G4UIWin32.hh" #elif defined(G4UI_USE_TCSH) #include "G4UIterminal.hh" #include "G4UItcsh.hh" #else #include "G4UIterminal.hh" #include "G4UIcsh.hh" #endif #define DISCARD_PARAMETER(p) (void)p ///////////////////////////////////////////////////// G4UIExecutive::G4UIExecutive(G4int argc, char** argv) : session(0), shell(0),isGUI(false) ///////////////////////////////////////////////////// { #if defined(G4UI_USE_QT) session = new G4UIQt(argc, argv); isGUI = true; #elif defined(G4UI_USE_XM) session = new G4UIXm(argc, argv); isGUI = true; #elif defined(G4UI_USE_WIN32) DISCARD_PARAMETER(argc); DISCARD_PARAMETER(argv); session = new G4UIWin32(); #elif defined(G4UI_USE_TCSH) DISCARD_PARAMETER(argc); DISCARD_PARAMETER(argv); shell = new G4UItcsh; session = new G4UIterminal(shell); #else DISCARD_PARAMETER(argc); DISCARD_PARAMETER(argv); shell = new G4UIcsh; session = new G4UIterminal(shell); #endif } /////////////////////////////// G4UIExecutive::~G4UIExecutive() /////////////////////////////// { } ////////////////////////////////////////// inline G4bool G4UIExecutive::IsGUI() const ////////////////////////////////////////// { return isGUI; } ///////////////////////////////////////////////////// inline G4UIsession* G4UIExecutive::GetSession() const ///////////////////////////////////////////////////// { return session; } //////////////////////////////////////////////////////////// inline void G4UIExecutive::SetPrompt(const G4String& prompt) //////////////////////////////////////////////////////////// { if(shell) shell-> SetPrompt(prompt); } ////////////////////////////////////////////////////////////// inline void G4UIExecutive::SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor) ////////////////////////////////////////////////////////////// { if(shell) shell-> SetLsColor(dirColor, cmdColor); } ///////////////////////////////////////// inline void G4UIExecutive::SessionStart() ///////////////////////////////////////// { session-> SessionStart(); delete session; }