00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
00043 }
00044
00045
00046 TApplicationImp *TGuiFactory::CreateApplicationImp(const char *classname, int *argc, char **argv)
00047 {
00048
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
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
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
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
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
00089
00090 return new TContextMenuImp(c);
00091 }
00092
00093
00094 TControlBarImp *TGuiFactory::CreateControlBarImp(TControlBar *c, const char *title)
00095 {
00096
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
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
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 }