Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

TApplication.h

Go to the documentation of this file.
00001 // @(#)root/base:$Name:  $:$Id: TApplication.h,v 1.8 2003/01/07 17:31:29 rdm Exp $
00002 // Author: Fons Rademakers   22/12/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TApplication
00013 #define ROOT_TApplication
00014 
00015 
00017 //                                                                      //
00018 // TApplication                                                         //
00019 //                                                                      //
00020 // This class creates the ROOT Application Environment that interfaces  //
00021 // to the windowing system eventloop and eventhandlers.                 //
00022 // This class must be instantiated exactly once in any given            //
00023 // application. Normally the specific application class inherits from   //
00024 // TApplication (see TRint).                                            //
00025 //                                                                      //
00027 
00028 #ifndef ROOT_TObject
00029 #include "TObject.h"
00030 #endif
00031 
00032 #ifndef ROOT_TApplicationImp
00033 #include "TApplicationImp.h"
00034 #endif
00035 
00036 class TObjArray;
00037 class TTimer;
00038 class TSignalHandler;
00039 
00040 
00041 class TApplication : public TObject {
00042 
00043 private:
00044    Int_t              fArgc;           //Number of command line arguments
00045    char             **fArgv;           //Command line arguments
00046    TApplicationImp   *fAppImp;         
00047    Bool_t             fReturnFromRun;  //When true return from Run()
00048    Bool_t             fNoLog;          //Do not process logon and logoff macros
00049    Bool_t             fNoLogo;         //Do not show splash screen and welcome message
00050    Bool_t             fQuit;           //Exit after having processed input files
00051    TObjArray         *fFiles;          //Array of input files (TObjString's)
00052    char              *fIdleCommand;    //Command to execute while application is idle
00053    TTimer            *fIdleTimer;      //Idle timer
00054    TSignalHandler    *fSigHandler;     //Interrupt handler
00055 
00056 protected:
00057    TApplication();
00058    virtual void Help(const char *line);
00059    virtual void InitializeColors();
00060    virtual void LoadGraphicsLibs();
00061    void         SetSignalHandler(TSignalHandler *sh) { fSigHandler = sh; }
00062 
00063 public:
00064    TApplication(const char *appClassName, int *argc, char **argv,
00065                 void *options = 0, int numOptions = 0);
00066    virtual ~TApplication();
00067 
00068    virtual void    GetOptions(int *argc, char **argv);
00069    TSignalHandler *GetSignalHandler() const { return fSigHandler; }
00070    virtual void    HandleIdleTimer();
00071    virtual Bool_t  HandleTermInput() { return kFALSE; }
00072    virtual void    Init() { fAppImp->Init(); }
00073    virtual void    ProcessLine(const char *line, Bool_t sync = kFALSE, int* error = 0);
00074    virtual void    ProcessFile(const char *line, int* error = 0);
00075    virtual void    Run(Bool_t retrn = kFALSE);
00076    virtual void    SetIdleTimer(UInt_t idleTimeInSec, const char *command);
00077    virtual void    RemoveIdleTimer();
00078    const char     *GetIdleCommand() const { return fIdleCommand; }
00079    virtual void    StartIdleing();
00080    virtual void    StopIdleing();
00081    virtual void    Terminate(int status = 0);
00082 
00083    virtual const char *ApplicationName() const { return fAppImp->ApplicationName(); }
00084    virtual void    Show()    { fAppImp->Show(); }
00085    virtual void    Hide()    { fAppImp->Hide(); }
00086    virtual TApplicationImp *GetApplicationImp(){ return fAppImp;}
00087    virtual void    Iconify() { fAppImp->Iconify(); }
00088    virtual Bool_t  IsCmdThread(){ return fAppImp->IsCmdThread(); }
00089    virtual void    Open()    { fAppImp->Open(); }
00090    virtual void    Raise()   { fAppImp->Raise(); }
00091    virtual void    Lower()   { fAppImp->Lower(); }
00092 
00093    int             Argc() const  { return fArgc; }
00094    char          **Argv() const  { return fArgv; }
00095    char           *Argv(int index) const { return fArgv[index]; }
00096    Bool_t          NoLogOpt() const { return fNoLog; }
00097    Bool_t          NoLogoOpt() const { return fNoLogo; }
00098    Bool_t          QuitOpt() const { return fQuit; }
00099    TObjArray      *InputFiles() const { return fFiles; }
00100    void            ClearInputFiles();
00101 
00102    Bool_t          ReturnFromRun() const { return fReturnFromRun; }
00103    void            SetReturnFromRun(Bool_t ret) { fReturnFromRun = ret; }
00104 
00105    static void     CreateApplication();
00106 
00107    ClassDef(TApplication,0)  //GUI application singleton
00108 };
00109 
00110 R__EXTERN TApplication *gApplication;
00111 
00112 #endif

Generated on Thu Dec 18 14:52:16 2003 for ROOT by doxygen1.2.16