From 9757810f097d67736e453887f1b317676fed9b90 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 27 Oct 2011 15:36:29 +0000 Subject: [PATCH] Merge from V6_3_BR branch (Windows porting) 27/10/2011 --- src/bases/BL_Exception.hxx | 12 ++++++++- src/engine/BL_Engine.hxx | 32 ++++++++++++++++++++++++ src/engine/BL_Job.hxx | 7 +++++- src/engine/BL_JobsManager.cxx | 4 +++ src/engine/BL_JobsManager.hxx | 3 ++- src/engine/BL_SALOMEServices.hxx | 5 ++-- src/engine/Makefile.am | 6 ++--- src/genericgui/BL_CreateJobWizard.cxx | 18 ++++++++++--- src/genericgui/BL_GenericGui.hxx | 4 ++- src/genericgui/BL_GenericGuiDefines.hxx | 32 ++++++++++++++++++++++++ src/genericgui/BL_JobTab.cxx | 6 ++++- src/genericgui/BL_QModelManager.cxx | 4 +++ src/genericgui/JM_EditSalomeResource.cxx | 4 +-- src/genericgui/Makefile.am | 2 +- src/salomegui/BL_SalomeGui.cxx | 2 +- src/salomegui/BL_SalomeGui.hxx | 10 ++++++++ src/salomegui/Makefile.am | 6 ++--- src/standalone/Makefile.am | 2 +- src/wrappers/BL_MainWindows_Qt.hxx | 12 ++++++++- src/wrappers/BL_MainWindows_SALOME.hxx | 12 ++++++++- src/wrappers/Makefile.am | 5 ++-- 21 files changed, 161 insertions(+), 27 deletions(-) create mode 100755 src/engine/BL_Engine.hxx create mode 100755 src/genericgui/BL_GenericGuiDefines.hxx diff --git a/src/bases/BL_Exception.hxx b/src/bases/BL_Exception.hxx index 439b519..d69869a 100644 --- a/src/bases/BL_Exception.hxx +++ b/src/bases/BL_Exception.hxx @@ -19,12 +19,22 @@ #ifndef __BL_EXCEPTION_HXX__ #define __BL_EXCEPTION_HXX__ +#ifdef WNT +# if defined BL_Bases_EXPORTS +# define BL_Bases_EXPORT __declspec( dllexport ) +# else +# define BL_Bases_EXPORT __declspec( dllimport ) +# endif +#else +# define BL_Bases_EXPORT +#endif + #include #include namespace BL { - class Exception : public std::exception + class BL_Bases_EXPORT Exception : public std::exception { protected: std::string _what; diff --git a/src/engine/BL_Engine.hxx b/src/engine/BL_Engine.hxx new file mode 100755 index 0000000..1299914 --- /dev/null +++ b/src/engine/BL_Engine.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +#ifndef __BL_ENGINE_HXX__ +#define __BL_ENGINE_HXX__ + +#ifdef WNT +# if defined BL_Engine_EXPORTS +# define BL_Engine_EXPORT __declspec( dllexport ) +# else +# define BL_Engine_EXPORT __declspec( dllimport ) +# endif +#else +# define BL_Engine_EXPORT +#endif + +#endif diff --git a/src/engine/BL_Job.hxx b/src/engine/BL_Job.hxx index 031ec24..d1355b2 100644 --- a/src/engine/BL_Job.hxx +++ b/src/engine/BL_Job.hxx @@ -20,14 +20,19 @@ #ifndef _BL_JOB_HXX_ #define _BL_JOB_HXX_ +#include "BL_Engine.hxx" #include "BL_Traces.hxx" #include #include +#ifdef WNT +#undef ERROR +#endif + namespace BL{ - class Job + class BL_Engine_EXPORT Job { public: Job(); diff --git a/src/engine/BL_JobsManager.cxx b/src/engine/BL_JobsManager.cxx index 071154a..92bfc68 100644 --- a/src/engine/BL_JobsManager.cxx +++ b/src/engine/BL_JobsManager.cxx @@ -20,6 +20,10 @@ #include "BL_JobsManager.hxx" #include +#ifdef WNT +#undef ERROR +#endif + BL::JobsManager::JobsManager(BL::SALOMEServices * salome_services) { DEBTRACE("Creating BL::JobsManager"); diff --git a/src/engine/BL_JobsManager.hxx b/src/engine/BL_JobsManager.hxx index e782551..12621fa 100644 --- a/src/engine/BL_JobsManager.hxx +++ b/src/engine/BL_JobsManager.hxx @@ -20,6 +20,7 @@ #ifndef _BL_JOBSMANAGER_HXX_ #define _BL_JOBSMANAGER_HXX_ +#include "BL_Engine.hxx" #include "BL_Job.hxx" #include "BL_SALOMEServices.hxx" #include "BL_Traces.hxx" @@ -34,7 +35,7 @@ namespace BL{ class SALOMEServices; - class JobsManager + class BL_Engine_EXPORT JobsManager { public: JobsManager(BL::SALOMEServices * salome_services); diff --git a/src/engine/BL_SALOMEServices.hxx b/src/engine/BL_SALOMEServices.hxx index 83295b5..a69a3c1 100644 --- a/src/engine/BL_SALOMEServices.hxx +++ b/src/engine/BL_SALOMEServices.hxx @@ -20,6 +20,7 @@ #ifndef _BL_SALOMESERVICES_HXX_ #define _BL_SALOMESERVICES_HXX_ +#include "BL_Engine.hxx" #include "BL_Traces.hxx" #include "BL_Job.hxx" @@ -39,7 +40,7 @@ namespace BL{ class JobsManager; - struct ResourceDescr + struct BL_Engine_EXPORT ResourceDescr { std::string name; std::string hostname; @@ -58,7 +59,7 @@ namespace BL{ std::string iprotocol; }; - class SALOMEServices : + class BL_Engine_EXPORT SALOMEServices : public POA_JOBMANAGER::LauncherObserver { public: diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 50ea66f..84fc257 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -27,11 +27,11 @@ libBL_Engine_la_SOURCES = BL_JobsManager.hxx BL_JobsManager.cxx \ BL_Observer.hxx libBL_Engine_la_CXXFLAGS = -I$(top_srcdir)/src/bases \ - $(OMNIORB_INCLUDES) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) \ -I$(KERNEL_ROOT_DIR)/include/salome \ -I../../idl -libBL_Engine_la_LIBADD = $(top_builddir)/src/bases/libBL_Bases.la \ - $(top_builddir)/idl/libJOBMANAGER_IDL.la \ +libBL_Engine_la_LIBADD = $(top_builddir)/src/bases/libBL_Bases.la $(top_builddir)/idl/libJOBMANAGER_IDL.la $(OMNIORB_LIBS) \ + $(KERNEL_LDFLAGS) -lSalomeIDLKernel -lSalomeNS -lSalomeLifeCycleCORBA \ @OMNIORB_LIBS@ diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 4416bd6..a97c52d 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -19,11 +19,17 @@ #include "BL_CreateJobWizard.hxx" #include "BL_JobsManager_QT.hxx" +#ifndef WNT #include -#include #include +#endif +#include #include +#ifdef WNT +#undef ERROR +#endif + BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services) { DEBTRACE("Creating BL::CreateJobWizard"); @@ -364,7 +370,7 @@ BL::JobNamePage::validatePage() // Check if job name already exists else { - if (_jobs_manager->job_already_exist(job_name.toStdString()) == false or _check_name == false) + if (_jobs_manager->job_already_exist(job_name.toStdString()) == false || _check_name == false) { return_value = true; } @@ -651,7 +657,7 @@ BL::BatchParametersPage::validatePage() int time_hour = field("duration_hour").toInt(); int time_min = field("duration_min").toInt(); - if (time_hour == 0 and time_min == 0) + if (time_hour == 0 && time_min == 0) { QMessageBox::warning(NULL, "Time Error", "Please enter an expected during time"); return false; @@ -721,6 +727,9 @@ BL::FilesPage::FilesPage(BL::CreateJobWizard * parent) // Default result directory is home directory (if we found it) // First try -> HOME +#ifdef WNT + _result_directory->setText(getenv("HOME")); +#else if (getenv("HOME")) _result_directory->setText(getenv("HOME")); else { @@ -729,6 +738,7 @@ BL::FilesPage::FilesPage(BL::CreateJobWizard * parent) if (pass_struct) _result_directory->setText(pass_struct->pw_dir); } +#endif registerField("result_directory", _result_directory); QGridLayout * output_box = new QGridLayout; @@ -766,7 +776,7 @@ BL::FilesPage::validatePage() } } - if (result_directory == "" and _output_files_list->count() != 0) + if (result_directory == "" && _output_files_list->count() != 0) { QMessageBox::warning(NULL, "Result Directory Error", "Please enter a result directory or remove output files"); return false; diff --git a/src/genericgui/BL_GenericGui.hxx b/src/genericgui/BL_GenericGui.hxx index a308828..79d93d3 100644 --- a/src/genericgui/BL_GenericGui.hxx +++ b/src/genericgui/BL_GenericGui.hxx @@ -22,6 +22,8 @@ #include +#include "BL_GenericGuiDefines.hxx" + #include "BL_Traces.hxx" #include "BL_SALOMEServices.hxx" @@ -38,7 +40,7 @@ namespace BL { - class GenericGui: public QObject + class BL_GenericGui_EXPORT GenericGui: public QObject { Q_OBJECT diff --git a/src/genericgui/BL_GenericGuiDefines.hxx b/src/genericgui/BL_GenericGuiDefines.hxx new file mode 100755 index 0000000..f193413 --- /dev/null +++ b/src/genericgui/BL_GenericGuiDefines.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +#ifndef __BL_GENERICGUIDEFINES_HXX__ +#define __BL_GENERICGUIDEFINES_HXX__ + +#ifdef WNT +# if defined BL_GenericGui_EXPORTS +# define BL_GenericGui_EXPORT __declspec( dllexport ) +# else +# define BL_GenericGui_EXPORT __declspec( dllimport ) +# endif +#else +# define BL_GenericGui_EXPORT +#endif + +#endif diff --git a/src/genericgui/BL_JobTab.cxx b/src/genericgui/BL_JobTab.cxx index 9b1baed..31ce3c1 100644 --- a/src/genericgui/BL_JobTab.cxx +++ b/src/genericgui/BL_JobTab.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,10 @@ #include "BL_JobTab.hxx" #include "BL_Traces.hxx" +#ifdef WNT +#undef ERROR +#endif + BL::JobTab::JobTab(QWidget *parent, BL::JobsManager_QT * jobs_manager) : QTabWidget(parent) { DEBTRACE("Creating BL::JobTab"); diff --git a/src/genericgui/BL_QModelManager.cxx b/src/genericgui/BL_QModelManager.cxx index d46199b..43b481c 100644 --- a/src/genericgui/BL_QModelManager.cxx +++ b/src/genericgui/BL_QModelManager.cxx @@ -20,6 +20,10 @@ #include "BL_QModelManager.hxx" #include "BL_JobsManager_QT.hxx" +#ifdef WNT +#undef ERROR +#endif + BL::QModelManager::QModelManager(QObject * parent, BL::JobsManager_QT * jobs_manager) : QObject(parent) { DEBTRACE("Creating BL::QModelManager"); diff --git a/src/genericgui/JM_EditSalomeResource.cxx b/src/genericgui/JM_EditSalomeResource.cxx index 8fac9cb..d6ec6a6 100644 --- a/src/genericgui/JM_EditSalomeResource.cxx +++ b/src/genericgui/JM_EditSalomeResource.cxx @@ -333,8 +333,8 @@ JM::EditSalomeResource::accept() resource.nb_node = _nb_node_line->value(); resource.nb_proc_per_node = _nb_proc_per_node_line->value(); - if (resource.name != "" and - resource.hostname != "" and + if (resource.name != "" && + resource.hostname != "" && resource.protocol != "") { _salome_services->addResource(resource); diff --git a/src/genericgui/Makefile.am b/src/genericgui/Makefile.am index 6a874da..e9f2768 100644 --- a/src/genericgui/Makefile.am +++ b/src/genericgui/Makefile.am @@ -46,7 +46,7 @@ libBL_GenericGui_la_CXXFLAGS = $(qt4_cppflags) \ -I$(top_srcdir)/src/bases \ -I$(top_srcdir)/src/engine \ -I$(KERNEL_ROOT_DIR)/include/salome \ - $(OMNIORB_INCLUDES) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) \ -I../../idl \ -I$(top_srcdir)/src/wrappers diff --git a/src/salomegui/BL_SalomeGui.cxx b/src/salomegui/BL_SalomeGui.cxx index d1518ee..f107ceb 100644 --- a/src/salomegui/BL_SalomeGui.cxx +++ b/src/salomegui/BL_SalomeGui.cxx @@ -128,7 +128,7 @@ BL::SalomeGui::onWindowActivated( SUIT_ViewWindow* svw) // --- Export the module extern "C" { - CAM_Module* createModule() + JOBMANAGER_EXPORT CAM_Module* createModule() { return new BL::SalomeGui(); } diff --git a/src/salomegui/BL_SalomeGui.hxx b/src/salomegui/BL_SalomeGui.hxx index f066f36..aa24ddc 100644 --- a/src/salomegui/BL_SalomeGui.hxx +++ b/src/salomegui/BL_SalomeGui.hxx @@ -20,6 +20,16 @@ #ifndef _BL_SALOMEGUI_HXX_ #define _BL_SALOMEGUI_HXX_ +#ifdef WNT +# if defined JOBMANAGER_EXPORTS +# define JOBMANAGER_EXPORT __declspec( dllexport ) +# else +# define JOBMANAGER_EXPORT __declspec( dllimport ) +# endif +#else +# define JOBMANAGER_EXPORT +#endif + #include #include diff --git a/src/salomegui/Makefile.am b/src/salomegui/Makefile.am index db04217..2059ce0 100644 --- a/src/salomegui/Makefile.am +++ b/src/salomegui/Makefile.am @@ -29,9 +29,9 @@ nodist_libJOBMANAGER_la_SOURCES = $(MOC_FILES) libJOBMANAGER_la_CXXFLAGS = $(qt4_cppflags) \ $(BOOST_CPPFLAGS) \ - $(OMNIORB_INCLUDES) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) \ -I$(top_builddir)/idl \ - -I. \ + -I. \ -I$(KERNEL_ROOT_DIR)/include/salome \ -I$(GUI_ROOT_DIR)/include/salome \ -I$(top_srcdir)/src/genericgui \ @@ -56,13 +56,11 @@ salomeinclude_HEADERS = BL_SalomeGui.hxx \ JOBMANAGER_version.h # resources files -LIBICONS = jobmanager.png ICONS = resources/jobmanager.png nodist_salomeres_SCRIPTS = resources/SalomeApp.xml dist_salomeres_DATA = ${ICONS} -#ICONS = $(LIBICONS:%=resources/%) # -------------------------------------------- # *.h --> *_moc.cxx diff --git a/src/standalone/Makefile.am b/src/standalone/Makefile.am index a388a99..2abec4c 100644 --- a/src/standalone/Makefile.am +++ b/src/standalone/Makefile.am @@ -27,7 +27,7 @@ jobmanager_gui_CXXFLAGS = $(qt4_cppflags) \ -I$(top_srcdir)/src/bases \ -I$(top_srcdir)/src/engine \ -I$(KERNEL_ROOT_DIR)/include/salome \ - $(OMNIORB_INCLUDES) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) \ -I../../idl \ -I$(top_srcdir)/src/wrappers \ -I$(top_srcdir)/src/genericgui diff --git a/src/wrappers/BL_MainWindows_Qt.hxx b/src/wrappers/BL_MainWindows_Qt.hxx index a84e0f0..19a9b68 100644 --- a/src/wrappers/BL_MainWindows_Qt.hxx +++ b/src/wrappers/BL_MainWindows_Qt.hxx @@ -21,12 +21,22 @@ #ifndef _BL_MAINWINDOWS_QT_HXX_ #define _BL_MAINWINDOWS_QT_HXX_ +#ifdef WNT +# if defined BL_Wrappers_Qt_EXPORTS +# define BL_Wrappers_Qt_EXPORT __declspec( dllexport ) +# else +# define BL_Wrappers_Qt_EXPORT __declspec( dllimport ) +# endif +#else +# define BL_Wrappers_Qt_EXPORT +#endif + #include "BL_MainWindows_Wrap.hxx" #include namespace BL { - class MainWindows_Qt : public MainWindows_Wrap, public QObject + class BL_Wrappers_Qt_EXPORT MainWindows_Qt : public MainWindows_Wrap, public QObject { public: MainWindows_Qt(QMainWindow * main_window); diff --git a/src/wrappers/BL_MainWindows_SALOME.hxx b/src/wrappers/BL_MainWindows_SALOME.hxx index 32c6f14..31b7428 100644 --- a/src/wrappers/BL_MainWindows_SALOME.hxx +++ b/src/wrappers/BL_MainWindows_SALOME.hxx @@ -21,6 +21,16 @@ #ifndef _BL_MAINWINDOWS_SALOME_HXX_ #define _BL_MAINWINDOWS_SALOME_HXX_ +#ifdef WNT +# if defined BL_Wrappers_SALOME_EXPORTS +# define BL_Wrappers_SALOME_EXPORT __declspec( dllexport ) +# else +# define BL_Wrappers_SALOME_EXPORT __declspec( dllimport ) +# endif +#else +# define BL_Wrappers_SALOME_EXPORT +#endif + #include "BL_MainWindows_Wrap.hxx" #include @@ -33,7 +43,7 @@ namespace BL { - class MainWindows_SALOME : virtual public MainWindows_Wrap, + class BL_Wrappers_SALOME_EXPORT MainWindows_SALOME : virtual public MainWindows_Wrap, virtual public SalomeApp_Module { public: diff --git a/src/wrappers/Makefile.am b/src/wrappers/Makefile.am index 3f2c9ac..e741f90 100644 --- a/src/wrappers/Makefile.am +++ b/src/wrappers/Makefile.am @@ -44,11 +44,12 @@ libBL_Wrappers_SALOME_la_SOURCES = BL_MainWindows_Wrap.hxx \ nodist_libBL_Wrappers_SALOME_la_SOURCES = libBL_Wrappers_SALOME_la_CXXFLAGS = $(qt4_cppflags) -I$(top_srcdir)/src/bases \ - $(OMNIORB_INCLUDES) $(BOOST_CPPFLAGS) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) $(BOOST_CPPFLAGS) \ -I$(KERNEL_ROOT_DIR)/include/salome \ -I$(GUI_ROOT_DIR)/include/salome libBL_Wrappers_SALOME_la_LDFLAGS = $(qt4_ldflags) -libBL_Wrappers_SALOME_la_LIBADD = -lQtGui -lQtCore $(top_builddir)/src/bases/libBL_Bases.la +libBL_Wrappers_SALOME_la_LIBADD = -lQtGui -lQtCore $(top_builddir)/src/bases/libBL_Bases.la $(OMNIORB_LIBS) \ + $(KERNEL_LDFLAGS) -lSalomeIDLKernel $(GUI_LDFLAGS) -lLightApp -lSalomeApp -lCAM -lsuit -- 2.39.2