From: ana Date: Tue, 20 Sep 2011 14:36:31 +0000 (+0000) Subject: Integrate patches for win32 version X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FV6_3_BR;p=modules%2Fjobmanager.git Integrate patches for win32 version --- 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..22d877c --- /dev/null +++ b/src/engine/BL_Engine.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2009-2010 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 9eee2ae..db3ff3a 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 37ce936..190f73f 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 7c8eb55..a2585c4 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.cxx b/src/genericgui/BL_GenericGui.cxx index 3254484..ee615f2 100644 --- a/src/genericgui/BL_GenericGui.cxx +++ b/src/genericgui/BL_GenericGui.cxx @@ -19,6 +19,10 @@ #include "BL_GenericGui.hxx" +#ifdef WNT +#undef ERROR +#endif + BL::GenericGui::GenericGui(BL::MainWindows_Wrap * wrapper) : QObject(wrapper->getDockParent()) { DEBTRACE("Creating BL::GenericGui"); @@ -307,7 +311,7 @@ BL::GenericGui::updateButtonsStates() DEBTRACE("BL::GenericGui::updateButtonsStates slot"); // First case: no job selected - if (_job_name_selected == "" and _row_selected == -1) + if (_job_name_selected == "" && _row_selected == -1) { _start_job_action->setEnabled(false); _delete_job_action->setEnabled(false); @@ -320,7 +324,7 @@ BL::GenericGui::updateButtonsStates() _restart_job_action->setEnabled(false); _buttons->disable_restart_button(); } - else if (_job_name_selected != "" and _row_selected != -1) + else if (_job_name_selected != "" && _row_selected != -1) { BL::Job * job = _jobs_manager->getJob(_job_name_selected.toStdString()); BL::Job::State job_state = job->getState(); diff --git a/src/genericgui/BL_GenericGui.hxx b/src/genericgui/BL_GenericGui.hxx index c5f2460..c28ff51 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..79f4b14 --- /dev/null +++ b/src/genericgui/BL_GenericGuiDefines.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2009-2010 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 765b443..c24e46b 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-2010 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 f3b0ba0..7b8f12d 100644 --- a/src/genericgui/BL_QModelManager.cxx +++ b/src/genericgui/BL_QModelManager.cxx @@ -19,6 +19,10 @@ #include "BL_QModelManager.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 b4112da..529d125 100644 --- a/src/salomegui/BL_SalomeGui.cxx +++ b/src/salomegui/BL_SalomeGui.cxx @@ -127,7 +127,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 edd16ef..f3e40fb 100644 --- a/src/salomegui/Makefile.am +++ b/src/salomegui/Makefile.am @@ -29,7 +29,7 @@ nodist_libJOBMANAGER_la_SOURCES = $(MOC_FILES) libJOBMANAGER_la_CXXFLAGS = $(qt4_cppflags) \ $(BOOST_CPPFLAGS) \ - $(OMNIORB_INCLUDES) \ + $(OMNIORB_INCLUDES) $(OMNIORB_CXXFLAGS) \ -I../../idl \ -I$(KERNEL_ROOT_DIR)/include/salome \ -I$(GUI_ROOT_DIR)/include/salome \ @@ -54,9 +54,8 @@ libJOBMANAGER_la_LIBADD = $(qt4_libs) \ salomeinclude_HEADERS = BL_SalomeGui.hxx # resources files -LIBICONS = SalomeApp.xml jobmanager.png +ICONS = resources/SalomeApp.xml resources/jobmanager.png 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 993c9a5..44cc2ea 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 96a96ee..4b2cfd2 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