00001
00002
00003
00004 #include "GuiTestAlg.h"
00005 #include "GuiSvc/IGuiSvc.h"
00006
00007 #include "GaudiKernel/MsgStream.h"
00008 #include "GaudiKernel/AlgFactory.h"
00009
00010 #include "src/test/Demo.h"
00011 #include "gui/GuiMgr.h"
00012
00013 static const AlgFactory<GuiTestAlg> Factory;
00014 const IAlgFactory& GuiTestAlgFactory = Factory;
00015
00016
00017
00018
00019 GuiTestAlg::GuiTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
00020 Algorithm(name, pSvcLocator), m_guiMgr(0), m_demo(0) {
00021
00022 }
00023
00024
00025
00027 StatusCode GuiTestAlg::initialize() {
00028
00029 MsgStream log(msgSvc(), name());
00030 log << MSG::INFO << "initialize" << endreq;
00031
00032
00033 setProperties();
00034
00035
00036 IGuiSvc* gsvc=0;
00037
00038
00039 StatusCode sc = service("GuiSvc", gsvc);
00040
00041 if( sc.isFailure()) {
00042 log << MSG::ERROR << "Could not find GuiSvc" << endreq;
00043 return sc;
00044 }
00045
00046 m_guiMgr = gsvc->guiMgr();
00047
00048 m_demo = new Demo(m_guiMgr->display());
00049
00050 return sc;
00051 }
00052
00053
00054
00055 StatusCode GuiTestAlg::execute() {
00056
00057 StatusCode sc = StatusCode::SUCCESS;
00058 MsgStream log( msgSvc(), name() );
00059
00060
00061 m_demo->process();
00062 return sc;
00063 }
00064
00065
00066
00067 StatusCode GuiTestAlg::finalize() {
00068
00069 delete m_demo;
00070 return StatusCode::SUCCESS;
00071 }
00072
00073
00074
00075
00076
00077