00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 //Author : Denis Bertini 01.11.2000 00017 00018 /************************************************************************** 00019 * Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI * 00020 * Planckstr. 1, 64291 Darmstadt, Germany * 00021 * All rights reserved. * 00022 * Contact: http://go4.gsi.de * 00023 * * 00024 * This software can be used under the license agreements as stated in * 00025 * Go4License.txt file which is part of the distribution. * 00026 ***************************************************************************/ 00027 00028 00030 // // 00031 // TQRootGuiFactory // 00032 // // 00033 // This class is a factory for Qt GUI components. It overrides // 00034 // the member functions of the ABS TGuiFactory. // 00035 // // 00037 00038 #include "tqrootguifactory.h" 00039 00040 #include "Riostream.h" 00041 00042 #include "TGuiFactory.h" 00043 #include "TRootCanvas.h" 00044 #include "tqcanvasimp.h" 00045 #include "lockguard.h" 00046 00047 //______________________________________________________________________________ 00048 TQRootGuiFactory::TQRootGuiFactory(const char *name, const char *title) 00049 : TRootGuiFactory(name, title) 00050 { 00051 Qtrootlockguard threadlock; 00052 // TQRootGuiFactory ctor. 00053 // The default implementation is not customized: 00054 // The ROOT TRootCanvas class is being used 00055 fCustom=kFALSE; 00056 00057 } 00058 00059 //______________________________________________________________________________ 00060 TQRootGuiFactory::~TQRootGuiFactory() 00061 { 00062 qDebug(" ~TQRootGuiFactory called \n"); 00063 } 00064 00065 //______________________________________________________________________________ 00066 TCanvasImp *TQRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, 00067 UInt_t width, UInt_t height) 00068 { 00069 // Create a ROOT native GUI version of TCanvasImp 00070 Qtrootlockguard threadlock; 00071 #if DEBUG_LEVEL>0 00072 qDebug("TQRootGuiFactory::CreateCanvasImp: \n creating a TCanvasImp with parameters: %x name:%s \n w:%i h:%i \n", 00073 c, title, width, height ); 00074 #endif 00075 00076 if ( fCustom ) { 00077 TQCanvasImp* cimp= new TQCanvasImp(c,title,width,height); 00078 return ( cimp ); 00079 }else{ 00080 return new TRootCanvas(c, title, width, height); 00081 } 00082 00083 } 00084 00085 //______________________________________________________________________________ 00086 TCanvasImp *TQRootGuiFactory::CreateCanvasImp(TCanvas *c, const char *title, 00087 Int_t x, Int_t y, UInt_t width, UInt_t height) 00088 { 00089 // Create a ROOT native GUI version of TCanvasImp 00090 Qtrootlockguard threadlock; 00091 #if DEBUG_LEVEL>0 00092 qDebug("TQRootGuiFactory::CreateCanvasImp:\n creating a TCanvasImp with parameters: %x name:%s \n w:%i h:%i x:%i y:%i\n", c, title, width, height, x, y ); 00093 #endif 00094 00095 if ( fCustom ) { 00096 TQCanvasImp* cimp= new TQCanvasImp(c,title,x,y,width,height); 00097 return cimp ; 00098 }else{ 00099 return new TRootCanvas(c, title, x, y, width, height); 00100 } 00101 00102 } 00103 00104 00105 00106 00107 //----------------------------END OF GO4 SOURCE FILE ---------------------