00001 // @(#)root/qtgsi:$Id: TQApplication.cxx 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Denis Bertini, M. Al-Turany 01/11/2000 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2006, 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 // // 00015 // TQApplication // 00016 // // 00017 // This class create the ROOT native GUI version of the ROOT // 00018 // application environment. This in contrast to the Win32 version. // 00019 // Once the native widgets work on Win32 this class can be folded into // 00020 // the TApplication class (since all graphic will go via TVirtualX). // 00021 // // 00022 ////////////////////////////////////////////////////////////////////////// 00023 00024 #include "TROOT.h" 00025 #include "TQApplication.h" 00026 #include "TQRootGuiFactory.h" 00027 00028 ClassImp(TQApplication) 00029 00030 //______________________________________________________________________________ 00031 TQApplication::TQApplication() 00032 :TApplication() 00033 { 00034 // Used by Dictionary() 00035 00036 } 00037 //______________________________________________________________________________ 00038 TQApplication::TQApplication(const char *appClassName, 00039 Int_t *argc, char **argv, void *options, Int_t numOptions) 00040 : TApplication(appClassName,argc,argv,options,numOptions) 00041 { 00042 // Create the root application and load the graphic libraries 00043 00044 fCustomized=kFALSE; 00045 LoadGraphicsLibs(); 00046 } 00047 00048 //______________________________________________________________________________ 00049 TQApplication::~TQApplication() 00050 { 00051 // Delete ROOT application environment. 00052 00053 if (gApplication) gApplication->Terminate(0); 00054 } 00055 00056 //______________________________________________________________________________ 00057 void TQApplication::LoadGraphicsLibs() 00058 { 00059 // Here we overload the LoadGraphicsLibs() function. 00060 // This function now just instantiates a QRootGuiFactory 00061 // object and redirect the global pointer gGuiFactory to point 00062 // to it. 00063 00064 if (gROOT->IsBatch()) return; 00065 gROOT->LoadClass("TCanvas", "Gpad"); 00066 gGuiFactory = new TQRootGuiFactory(); 00067 00068 } 00069 00070 //______________________________________________________________________________ 00071 void TQApplication::SetCustomized() 00072 { 00073 // Set the custom flag 00074 00075 fCustomized = kTRUE; 00076 if (fCustomized) ((TQRootGuiFactory*) gGuiFactory)->SetCustomFlag(kTRUE); 00077 }