Commit 2572dbc5 authored by Stezowski Olivier's avatar Stezowski Olivier
Browse files

test link in svn

git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@1770 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent 689e33ec
......@@ -11,7 +11,7 @@ set(GWLIBNAME GWCORE)
# internal and external dependencies
#
set( EXTRA_INTERNAL_LIBRARIES GWCORE)
set( EXTRA_EXTERNAL_LIBRARIES Core Cint Graf MathCore XMLParser Hist)
set( EXTRA_EXTERNAL_LIBRARIES Core Cint Graf MathCore XMLParser Hist Gui)
#
# headers / dictionnary / sources
#
......@@ -121,8 +121,8 @@ install(TARGETS ${GWLIBNAME}
ARCHIVE DESTINATION lib
COMPONENT libraries)
#
install(FILES ${headers} DESTINATION include COMPONENT headers )
install(FILES ${headers} DESTINATION ${GW_INCLUDE_DIR} COMPONENT headers )
......
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* stezow(AT)ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* aLong_t with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** @file CentralLog.h
*/
#ifndef _CentralLog
#define _CentralLog
#define _CENTRALLOG_H _CentralLog
#include <string>
#include <list>
class CentralLog;
//! To properly destroy the singleton
/*!
*/
class CentralLogDestroyer
{
public:
CentralLogDestroyer(CentralLog *s = 0x0);
~CentralLogDestroyer();
void SetCentralLog(CentralLog *);
private:
CentralLog *fCentralLog;
};
class LogCollector;
class LogMessage;
//! CentralLog is a singleton that should be destroyed at exit time
/*!
*/
class CentralLog
{
private:
static CentralLog *gTheCentralLog;
static CentralLogDestroyer gTheCentralLogDestroyer;
protected:
friend class CentralLogDestroyer;
private:
//! the current collector
LogCollector *fCurrentCollector;
//! list of available collectors
std::list < LogCollector * > fListOfCollectors;
private:
CentralLog();
~CentralLog();
public:
//! CentralLog is a singleton
static CentralLog *theCentralLog();
//! to change the current collector
bool ChangeCollector(std::string whichlog = std::string("Null"));
//! Check if the given collector already exists
/*!
*/
bool IsCollector(std::string whichlog);
//! Return the current logcollector
LogCollector *GetCurrentLogCollector() const;
//! Add a new LogCollector to the list of known collectors
/*!
if a log with a similar name already exist, it is removed from the central log
and return by this method. It is then the charge of the user to delete it
if the collector is deletable.
*/
LogCollector *Add ( LogCollector * );
//! Remove a collector from the list of available collectors
/*!
*/
// void Remove( std::string );
};
#endif
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* agata(AT)ipnl.in2p3.fr *
* agata(AT)ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -36,6 +36,9 @@
#include "LogMessage.h"
#endif
#include "TGClient.h"
#include "TGMimeTypes.h"
using namespace Gw;
ClassImp(Env);
......@@ -51,46 +54,22 @@ const char *Env::GetPath(const char *whichpath)
return GW_Version;
}
if ( which.Contains("LibraryPath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_LibraryPath_cmake;
#else
return GW_LibraryPath;
#endif
return GW_LibraryPath;
}
if ( which.Contains("BinaryPath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_BinaryPath_cmake;
#else
return GW_BinaryPath;
#endif
}
if ( which.Contains("IncludePath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_IncludePath_cmake;
#else
return GW_IncludePath;
#endif
}
if ( which.Contains("IconsPath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_IconsPath_cmake;
#else
return GW_IconsPath;
#endif
}
if ( which.Contains("NdbPath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_NdbPath_cmake;
#else
return GW_NdbPath;
#endif
}
if ( which.Contains("MacrosPath",TString::kIgnoreCase) ) {
#ifdef IS_CMAKE
return GW_MacrosPath_cmake;
#else
return GW_MacrosPath;
#endif
}
return "NOT_DEFINED";
......@@ -101,4 +80,30 @@ void Env::SetDebug(short debug)
LogMessage::SetDebug(debug);
}
void Env::AddRMimeType()
{
static Bool_t has_done = false; TGMimeTypes* mineTypes = gClient->GetMimeTypeList();
if ( has_done == false ) {
char action[256] = {0}; Int_t added = 0;
if ( !mineTypes->GetAction("Gw::GCond1D",action) ) {
mineTypes->AddType("[gw/gwgcond1d]"," Gw::GCond1D", "selection_t.xpm", "selection_t.xpm", "->Draw()");
added++;
}
if ( !mineTypes->GetAction("Gw::GCond2D",action) ) {
mineTypes->AddType("[gw/gwgcond2d]"," Gw::GCond2D", "cut.xpm", "cut.xpm", "->Draw()");
added++;
}
if ( !mineTypes->GetAction("*.spe",action) ) {
mineTypes->AddType("[root/file]"," *.eg *.spe *.s", "hdb_s.xpm", "hdb_t.xpm", "Gw::HistoConverter::DrawSpectrum(%s)");
added++;
}
if ( added > 0 ) {
has_done = true;
mineTypes->SaveMimes();
}
}
}
......@@ -54,6 +54,9 @@ public:
virtual ~Env()
{;}
//! check mime type and add those proper to gw
static void AddRMimeType();
//! to get a particular GW environment variable
/*!
Currently, the following path are defined:
......
......@@ -33,10 +33,6 @@
#ifndef GW_CONFIG_H
#define GW_CONFIG_H
// With cmake, no need anymore install. So to be sure it would works in any cases (with/without install)
// All path are multiply by 2. First, it checks cmake related then install related
#define IS_CMAKE
#define GW_Version "@GammaWare_VERSION@";
#define GW_LibraryPath "@GW_LIB_DIR@";
......@@ -45,12 +41,5 @@
#define GW_IconsPath "@GW_DATA_DIR@/gw/icons";
#define GW_NdbPath "@GW_DATA_DIR@/gw/ndb";
#define GW_MacrosPath "@GW_DATA_DIR@/gw/macros";
#define GW_LibraryPath_cmake "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@";
#define GW_BinaryPath_cmake "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@";
#define GW_IncludePath_cmake "@CMAKE_BINARY_DIR@/include";
#define GW_IconsPath_cmake "@CMAKE_BINARY_DIR@/icons";
#define GW_NdbPath_cmake "@CMAKE_BINARY_DIR@/ndb";
#define GW_MacrosPath_cmake "@CMAKE_BINARY_DIR@/macros";
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment