TGuiFactory.cxx

Go to the documentation of this file.
00001 // @(#)root/base:$Id: TGuiFactory.cxx 34286 2010-07-01 20:38:57Z rdm $
00002 // Author: Fons Rademakers   15/11/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 //////////////////////////////////////////////////////////////////////////
00013 //                                                                      //
00014 // TGuiFactory                                                          //
00015 //                                                                      //
00016 // This ABC is a factory for GUI components. Depending on which         //
00017 // factory is active one gets either ROOT native (X11 based with Win95  //
00018 // look and feel), Win32 or Mac components.                             //
00019 // In case there is no platform dependent implementation on can run in  //
00020 // batch mode directly using an instance of this base class.            //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #include "TGuiFactory.h"
00025 #include "TApplicationImp.h"
00026 #include "TCanvasImp.h"
00027 #include "TBrowserImp.h"
00028 #include "TContextMenuImp.h"
00029 #include "TControlBarImp.h"
00030 #include "TInspectorImp.h"
00031 #include "TROOT.h"
00032 
00033 TGuiFactory *gGuiFactory = 0;
00034 TGuiFactory *gBatchGuiFactory = 0;
00035 
00036 ClassImp(TGuiFactory)
00037 
00038 //______________________________________________________________________________
00039 TGuiFactory::TGuiFactory(const char *name, const char *title)
00040     : TNamed(name, title)
00041 {
00042    // TGuiFactory ctor only called by derived classes.
00043 }
00044 
00045 //______________________________________________________________________________
00046 TApplicationImp *TGuiFactory::CreateApplicationImp(const char *classname, int *argc, char **argv)
00047 {
00048    // Create a batch version of TApplicationImp.
00049 
00050    return new TApplicationImp(classname, argc, argv);
00051 }
00052 
00053 //______________________________________________________________________________
00054 TCanvasImp *TGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height)
00055 {
00056    // Create a batch version of TCanvasImp.
00057 
00058    return new TCanvasImp(c, title, width, height);
00059 }
00060 
00061 //______________________________________________________________________________
00062 TCanvasImp *TGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height)
00063 {
00064    // Create a batch version of TCanvasImp.
00065 
00066    return new TCanvasImp(c, title, x, y, width, height);
00067 }
00068 
00069 //______________________________________________________________________________
00070 TBrowserImp *TGuiFactory::CreateBrowserImp(TBrowser *b, const char *title, UInt_t width, UInt_t height, Option_t *)
00071 {
00072    // Create a batch version of TBrowserImp.
00073 
00074    return new TBrowserImp(b, title, width, height);
00075 }
00076 
00077 //______________________________________________________________________________
00078 TBrowserImp *TGuiFactory::CreateBrowserImp(TBrowser *b, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height, Option_t *)
00079 {
00080    // Create a batch version of TBrowserImp.
00081 
00082    return new TBrowserImp(b, title, x, y, width, height);
00083 }
00084 
00085 //______________________________________________________________________________
00086 TContextMenuImp *TGuiFactory::CreateContextMenuImp(TContextMenu *c, const char *, const char *)
00087 {
00088    // Create a batch version of TContextMenuImp.
00089 
00090    return new TContextMenuImp(c);
00091 }
00092 
00093 //______________________________________________________________________________
00094 TControlBarImp *TGuiFactory::CreateControlBarImp(TControlBar *c, const char *title)
00095 {
00096    // Create a batch version of TControlBarImp.
00097 
00098    return new TControlBarImp(c, title);
00099 }
00100 
00101 //______________________________________________________________________________
00102 TControlBarImp *TGuiFactory::CreateControlBarImp(TControlBar *c, const char *title, Int_t x, Int_t y)
00103 {
00104    // Create a batch version of TControlBarImp.
00105 
00106    return new TControlBarImp(c, title, x, y);
00107 }
00108 
00109 //______________________________________________________________________________
00110 TInspectorImp *TGuiFactory::CreateInspectorImp(const TObject *obj, UInt_t width, UInt_t height)
00111 {
00112    // Create a batch version of TInspectorImp.
00113 
00114    if (gROOT->IsBatch()) {
00115       return new TInspectorImp(obj, width, height);
00116    }
00117 
00118    gROOT->ProcessLine(Form("TInspectCanvas::Inspector((TObject*)0x%lx);", (ULong_t)obj));
00119    return 0;
00120 }

Generated on Tue Jul 5 14:11:21 2011 for ROOT_528-00b_version by  doxygen 1.5.1