-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : HELLO_version.h
// Author : Vadim SANDLER
// Module : SALOME
#define HELLO_VERSION_STR "@VERSION@"
#define HELLO_VERSION @XVERSION@
+#define HELLO_DEVELOPMENT @VERSION_DEV@
#endif // __HELLO_VERSION_H__
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
- -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
- -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
+if HELLO_ENABLE_GUI
+ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+else !HELLO_ENABLE_GUI
+ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+endif
SUBDIRS = idl adm_local resources src bin doc
-DISTCLEANFILES = a.out aclocal.m4 configure
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool
salomeinclude_DATA = HELLO_version.h
dist-hook:
rm -rf `find $(distdir) -name CVS`
+
+usr_docs:
+ (cd doc && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
+
+dev_docs:
+ (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
+
+
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = unix
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of Salome binary distribution
#
# Author : Marc Tajchman (CEA, 2002)
])dnl
+AC_DEFUN([CHECK_SALOME_GUI],[
+ CHECK_GUI_MODULE()
+ SalomeGUI_ok=${LightGUI_ok}
+])dnl
+AC_DEFUN([CHECK_CORBA_IN_GUI],[
+ CHECK_GUI_MODULE()
+ CORBA_IN_GUI=${FullGUI_ok}
+ AC_SUBST(CORBA_IN_GUI)
+])dnl
-dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
-dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License.
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License.
dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
+
# Check availability of HELLO module binary distribution
#
# Author : Marc Tajchman (CEA, 2002)
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+# ============================================================
+# The following is to avoid PACKAGE_... env variable
+# redefinition compilation warnings
+# ============================================================
#
+AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h
+
# ============================================================
# This file defines the common definitions used in several
# Makefile. This file must be included, if needed, by the file
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author : Guillaume Boulant (CSSI)
# Module : COMPONENT
-SALOME 2 EXEMPLE MODULE C++ : HELLO : @VERSION@
+[SALOME HELLO] : @VERSION@
+[DEVELOPMENT] : @VERSION_DEV@
+[DESCRIPTION] : Sample SALOME module
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#!/usr/bin/env python
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# 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.
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# 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.
+# 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.
#
-# 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
+# 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.
#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# 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
#
-#!/usr/bin/env python
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
def test(clt):
"""
Test function that creates an instance of HELLO component
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
if [ -z "${KERNEL_ROOT_DIR}" ] ; then
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+
+##
+# Test functionality of HELLO module
+##
+
+# initialize salome session
+import salome
+salome.salome_init()
+
+# get reference to the HELLO engine
+import HELLO_ORB
+hello = salome.lcc.FindOrLoadComponent('FactoryServer', 'HELLO')
+
+# test HELLO module
+print "Say hello to John: should be OK"
+if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_OK:
+ print "ERROR: wrong operation code is returned"
+else:
+ print "OK"
+print "Say hello to John: should answer 'already met'"
+if hello.hello(salome.myStudy, "John") != HELLO_ORB.OP_ERR_ALREADY_MET:
+ print "ERROR: wrong operation code is returned"
+else:
+ print "OK"
+print "Say goodbye to Margaret: should answer 'did not meet yet'"
+if hello.goodbye(salome.myStudy, "Margaret") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
+ print "ERROR: wrong operation code is returned"
+else:
+ print "OK"
+print "Say hello to John: should be OK"
+if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_OK:
+ print "ERROR: wrong operation code is returned"
+else:
+ print "OK"
+print "Say hello to John: should answer 'did not meet yet'"
+if hello.goodbye(salome.myStudy, "John") != HELLO_ORB.OP_ERR_DID_NOT_MEET:
+ print "ERROR: wrong operation code is returned"
+else:
+ print "OK"
#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
-# 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 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.
+# 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
+# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# Tool for updating list of .in file for the SALOME project
# and regenerating configure script
# Author :
########################################################################
# Test if the GUI_ROOT_DIR is set correctly
-if test ! -d "${GUI_ROOT_DIR}"; then
- echo "failed : GUI_ROOT_DIR variable is not correct !"
- exit
-fi
+#if test ! -d "${GUI_ROOT_DIR}"; then
+# echo "failed : GUI_ROOT_DIR variable is not correct !"
+# exit
+#fi
cd ${CONF_DIR}
ABS_CONF_DIR=`pwd`
-mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
-cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-
-#cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
-# check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
-# do
-# rm -f salome_adm/unix/config_files/${deprecated}
-# done
-
+########################################################################
# ____________________________________________________________________
# aclocal creates the aclocal.m4 file from the standard macro and the
-# custom macro embedded in the directory salome_adm/unix/config_files
+# custom macro embedded in the directory adm_local/unix/config_files
# and KERNEL config_files directory.
# output:
# aclocal.m4
# autom4te.cache (directory)
-echo "====================================================== aclocal"
-
-aclocal -I adm_local/unix/config_files \
- -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
- -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+echo "======================================================= aclocal"
+
+if test -d "${GUI_ROOT_DIR}"; then
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
+else
+ aclocal -I adm_local/unix/config_files \
+ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
+fi
# ____________________________________________________________________
# libtoolize creates some configuration files (ltmain.sh,
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output:
-# salome_adm/unix/config_files/config.guess
-# salome_adm/unix/config_files/config.sub
-# salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
+# adm_local/unix/config_files/config.guess
+# adm_local/unix/config_files/config.sub
+# adm_local/unix/config_files/ltmain.sh
+echo "==================================================== libtoolize"
libtoolize --force --copy --automake || exit 1
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files.
# output:
-# salome_adm/unix/config_files/compile
-# salome_adm/unix/config_files/depcomp
-# salome_adm/unix/config_files/install-sh
-# salome_adm/unix/config_files/missing
-# salome_adm/unix/config_files/py-compile
+# adm_local/unix/config_files/compile
+# adm_local/unix/config_files/depcomp
+# adm_local/unix/config_files/install-sh
+# adm_local/unix/config_files/missing
+# adm_local/unix/config_files/py-compile
# Makefile.in (from Makefile.am)
echo "====================================================== automake"
#!/bin/sh
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
#exit
# ==================== ON SORT AVANT
-find bin -name Makefile.in | xargs rm -f
-find doc -name Makefile.in | xargs rm -f
-find idl -name Makefile.in | xargs rm -f
-find resources -name Makefile.in | xargs rm -f
-find salome_adm -name Makefile.in | xargs rm -f
-find src -name Makefile.in | xargs rm -f
-rm -f Makefile.in
+find . -name Makefile.in | xargs rm -f
+( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh ltmain.sh missing py-compile )
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# PLEASE DO NOT MODIFY configure.in FILE
# ALL CHANGES WILL BE DISCARDED BY THE NEXT
# build_configure COMMAND
# Modified by : Marc Tajchman (CEA)
# Created from configure.in.base
#
-AC_INIT([Salome2 Project HELLO module],[5.1.0], [webmaster.salome@opencascade.com], [SalomeHELLO])
-AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
+AC_INIT([Salome2 Project HELLO module],[6.5.0], [webmaster.salome@opencascade.com], [SalomeHELLO])
+AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([-Wno-portability])
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION)
+VERSION_DEV=1
+AC_SUBST(VERSION_DEV)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=hello
AC_PROG_MAKE_SET
AC_PROG_INSTALL
+AC_LOCAL_INSTALL
dnl
dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
dnl full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
- INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh
+ INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
;;
esac
echo
echo ---------------------------------------------
-echo testing QT
+echo Testing GUI
+echo ---------------------------------------------
+echo
+
+CHECK_GUI_MODULE
+
+gui_ok=no
+if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then
+ gui_ok=yes
+fi
+
+AM_CONDITIONAL(HELLO_ENABLE_GUI, [test "${gui_ok}" = "yes"])
+
+if test "${SalomeGUI_need}" == "yes"; then
+ if test "${FullGUI_ok}" != "yes"; then
+ AC_MSG_WARN(For configure HELLO module necessary full GUI!)
+ fi
+elif test "${SalomeGUI_need}" == "auto"; then
+ if test "${FullGUI_ok}" != "yes"; then
+ AC_MSG_WARN(Full GUI not found. Build will be done without GUI!)
+ fi
+elif test "${SalomeGUI_need}" == "no"; then
+ echo Build without GUI option has been chosen
+fi
+
+if test "${gui_ok}" = "yes"; then
+ echo
+ echo ---------------------------------------------
+ echo testing QT
+ echo ---------------------------------------------
+ echo
+
+ CHECK_QT
+
+fi
+
+echo
+echo ---------------------------------------------
+echo testing MPI
echo ---------------------------------------------
echo
-CHECK_QT
+CHECK_MPI
+
+echo
+echo ---------------------------------------------
+echo testing HDF5
+echo ---------------------------------------------
+echo
+
+CHECK_HDF5
echo
echo ---------------------------------------------
echo
echo ---------------------------------------------
-echo Testing Kernel
+echo Testing html generators
echo ---------------------------------------------
echo
-CHECK_KERNEL
+CHECK_HTML_GENERATORS
echo
echo ---------------------------------------------
-echo Testing GUI
-echo ---------------------------------------------
-echo
-
-CHECK_SALOME_GUI
-
-echo
-echo ---------------------------------------------
-echo Testing full GUI
+echo Testing Kernel
echo ---------------------------------------------
echo
-CHECK_CORBA_IN_GUI
-if test "x${CORBA_IN_GUI}" != "xyes"; then
- echo "failed : For configure HELLO1 module necessary full GUI !"
- exit
-fi
-
+CHECK_KERNEL
echo
echo ---------------------------------------------
echo
echo Configure
-variables="cc_ok threads_ok boost_ok python_ok omniORB_ok qt_ok Kernel_ok SalomeGUI_ok"
+
+if test "${gui_ok}" = "yes"; then
+ variables="cc_ok threads_ok boost_ok python_ok omniORB_ok qt_ok hdf5_ok doxygen_ok Kernel_ok gui_ok"
+elif test "${SalomeGUI_need}" != "no"; then
+ variables="cc_ok threads_ok boost_ok python_ok omniORB_ok hdf5_ok doxygen_ok Kernel_ok gui_ok"
+else
+ variables="cc_ok threads_ok boost_ok python_ok omniORB_ok hdf5_ok doxygen_ok Kernel_ok"
+fi
for var in $variables
do
chmod +x ./bin/*; \
])
+AC_HACK_LIBTOOL
+AC_CONFIG_COMMANDS([hack_libtool],[
+sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
+ $(pwd)/hack_libtool \1 \"\$[@]\" \n\
+}\n\
+CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
+],[])
+
# This list is initiated using autoscan and must be updated manually
# when adding a new file <filename>.in to manage. When you execute
# autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration.
AC_OUTPUT([ \
- ./salome_adm/unix/SALOMEconfig.h \
- ./adm_local/Makefile \
- ./adm_local/unix/Makefile \
- ./adm_local/unix/config_files/Makefile \
- ./bin/VERSION \
- ./bin/runAppli \
- ./bin/Makefile \
- ./doc/Makefile \
- ./HELLO_version.h \
- ./resources/HELLOCatalog.xml \
- ./src/Makefile \
- ./src/HELLO/Makefile \
- ./src/HELLOGUI/Makefile \
- ./resources/Makefile \
- ./idl/Makefile \
+ adm_local/Makefile \
+ adm_local/unix/Makefile \
+ adm_local/unix/config_files/Makefile \
+ bin/VERSION \
+ bin/runAppli \
+ bin/Makefile \
+ doc/Makefile \
+ doc/doxyfile \
+ doc/static/header.html \
+ HELLO_version.h \
+ resources/HELLOCatalog.xml \
+ resources/SalomeApp.xml \
+ src/Makefile \
+ src/HELLO/Makefile \
+ src/HELLOGUI/Makefile \
+ resources/Makefile \
+ idl/Makefile \
Makefile \
])
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-dist_doc_DATA = dev_guide.html
+EXTRA_DIST += images static/footer.html static/doxygen.css
+
+guidocdir = $(docdir)/gui/HELLO
+guidoc_DATA = images/head.png
+
+usr_docs: doxyfile
+ $(DOXYGEN) doxyfile
+
+docs: usr_docs
+
+dev_docs:
+
+clean-local:
+ @for filen in `find . -maxdepth 1` ; do \
+ case $${filen} in \
+ ./Makefile | ./doxyfile ) ;; \
+ . | .. | ./static) ;; \
+ *) echo "Removing $${filen}" ; rm -rf $${filen} ;; \
+ esac ; \
+ done ;
+
+install-data-local: usr_docs
+ $(INSTALL) -d $(DESTDIR)$(docdir)/gui/HELLO
+ @for filen in `find . -maxdepth 1` ; do \
+ case $${filen} in \
+ ./Makefile | ./doxyfile | ./doxyfile.bak ) ;; \
+ . | .. | ./static ) ;; \
+ *) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/HELLO ;; \
+ esac ; \
+ done ;
-EXTRA_DIST += dev_guide.txt
+uninstall-local:
+ rm -rf $(DESTDIR)$(docdir)/gui/HELLO
+++ /dev/null
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.3.0: http://docutils.sourceforge.net/" />
-<title>Guide pour le développement d'un module SALOME 2 en C++</title>
-<link rel="stylesheet" href="default.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="guide-pour-le-d-veloppement-d-un-module-salome-2-en-c">
-<h1 class="title">Guide pour le développement d'un module SALOME 2 en C++</h1>
-<table class="docinfo" frame="void" rules="none">
-<col class="docinfo-name" />
-<col class="docinfo-content" />
-<tbody valign="top">
-<tr class="field"><th class="docinfo-name">Auteur:</th><td class="field-body">Crouzet N.</td>
-</tr>
-</tbody>
-</table>
-<div class="contents topic" id="contents">
-<p class="topic-title"><a name="contents">Contents</a></p>
-<ul class="auto-toc simple">
-<li><a class="reference" href="#pr-sentation" id="id1" name="id1">1 Présentation</a></li>
-<li><a class="reference" href="#les-tapes-de-construction-du-module-exemple" id="id2" name="id2">2 Les étapes de construction du module exemple</a></li>
-<li><a class="reference" href="#cr-ation-de-l-arborescence-du-module" id="id3" name="id3">3 Création de l'arborescence du module</a></li>
-<li><a class="reference" href="#interface-idl" id="id4" name="id4">4 Interface idl</a></li>
-<li><a class="reference" href="#impl-mentation-c" id="id5" name="id5">5 Implémentation C++</a><ul class="auto-toc">
-<li><a class="reference" href="#les-sources" id="id6" name="id6">5.1 Les sources</a></li>
-<li><a class="reference" href="#makefile" id="id7" name="id7">5.2 Makefile</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#pilotage-du-composant-depuis-python-mode-tui" id="id8" name="id8">6 Pilotage du composant depuis Python (mode TUI)</a></li>
-<li><a class="reference" href="#interface-graphique" id="id9" name="id9">7 Interface graphique</a><ul class="auto-toc">
-<li><a class="reference" href="#introduction" id="id10" name="id10">7.1 Introduction</a></li>
-<li><a class="reference" href="#choix-des-widgets" id="id11" name="id11">7.2 Choix des widgets</a><ul class="auto-toc">
-<li><a class="reference" href="#description-xml" id="id12" name="id12">7.2.1 Description xml</a></li>
-<li><a class="reference" href="#convention" id="id13" name="id13">7.2.2 Convention</a></li>
-</ul>
-</li>
-<li><a class="reference" href="#impl-mentation-de-l-ihm" id="id14" name="id14">7.3 Implémentation de l'IHM</a><ul class="auto-toc">
-<li><a class="reference" href="#gestion-des-v-nements" id="id15" name="id15">7.3.1 Gestion des évènements</a></li>
-<li><a class="reference" href="#classes-disponibles" id="id16" name="id16">7.3.2 Classes disponibles</a></li>
-<li><a class="reference" href="#gestion-du-multi-linguisme" id="id17" name="id17">7.3.3 Gestion du multi-linguisme</a></li>
-</ul>
-</li>
-</ul>
-</li>
-<li><a class="reference" href="#r-gles-syntaxiques-de-nommage" id="id18" name="id18">8 Règles syntaxiques de nommage</a></li>
-</ul>
-</div>
-<div class="section" id="pr-sentation">
-<h1><a class="toc-backref" href="#id1" name="pr-sentation">1 Présentation</a></h1>
-<p>Ce document a pour objectif de décrire les différentes étapes
-du développement d'un module SALOME 2 en C++.
-Il fait suite au document "Guide pour le développement d'un module SALOME 2 en
-Python", qui documente de module PYHELLO, et en reprend la démarche :
-construction pas à pas d'un module HELLO.
-Comme de nombreux points ne sont pas repris, il est recommendé de lire ce
-document préalablement.</p>
-</div>
-<div class="section" id="les-tapes-de-construction-du-module-exemple">
-<h1><a class="toc-backref" href="#id2" name="les-tapes-de-construction-du-module-exemple">2 Les étapes de construction du module exemple</a></h1>
-<p>Le composant choisi pour illustrer le processus de construction en C++
-est le même que celui choisi pour illustrer la construction du module python :
-il implémentera donc la même interface idl Corba.
-Il sera complété par un GUI graphique écrit en Qt.</p>
-<p>Les différentes étapes du développement seront les suivantes :</p>
-<blockquote>
-<ul class="simple">
-<li>créer une arborescence de module</li>
-<li>créer un composant SALOME 2 chargeable par un container C++</li>
-<li>configurer le module pour que le composant soit connu de SALOME</li>
-<li>ajouter un GUI graphique</li>
-<li>rendre le composant utilisable dans le superviseur</li>
-</ul>
-</blockquote>
-</div>
-<div class="section" id="cr-ation-de-l-arborescence-du-module">
-<h1><a class="toc-backref" href="#id3" name="cr-ation-de-l-arborescence-du-module">3 Création de l'arborescence du module</a></h1>
-<p>Dans un premier temps, on se contentera de mettre dans le module exemple un composant
-SALOME écrit en C++ qui sera chargeable par un container C++.
-Il suffit donc d'une interface idl et d'une implantation C++ du composant.
-Pour mettre en oeuvre ceci dans un module SALOME 2, il nous faut reproduire l'arborescence de
-fichier standard suivante:</p>
-<pre class="literal-block">
-+ HELLO1_SRC
- + build_configure
- + configure.in.base
- + Makefile.in
- + adm_local
- + unix
- + make_commence.in
- + make_omniorb.in
- + config_files
- + bin
- + VERSION
- + runAppli.in
- + runSalome.py
- + idl
- + Makefile.in
- + HELLO_Gen.idl
- + src
- + Makefile.in
- + HELLO
- + Makefile.in
- + HELLO.cxx
- + HELLO.hxx
- + doc
-</pre>
-<p>Pour cela, on recopie l'arborescence de PYHELLO, et on modifie où nécessaire
-PYHELLO en HELLO:</p>
-<pre class="literal-block">
-cp -r PYHELLO1_SRC HELLO1_SRC
-cd HELLO1_SRC
-mv idl/PYHELLO_Gen.idl idl/HELLO_Gen.idl
-mv src/PYHELLO src/HELLO
-</pre>
-</div>
-<div class="section" id="interface-idl">
-<h1><a class="toc-backref" href="#id4" name="interface-idl">4 Interface idl</a></h1>
-<p>Dans le répertoire idl, nous modifions le fichier idl HELLO_Gen.idl : le
-module défini est renommé HELLO_ORB, et l'interface en HELLO_Gen.
-Le service rendu reste le même : à partir d'une chaine de caractères
-fournie comme unique argument, retour d'une chaine de caractères obtenue
-par concaténation de "Hello, " et de la chaine d'entrée.
-Ce service est spécifié par la fonction makeBanner.</p>
-<p>Un utilitaire de documentation basé sur doxygen a été mis en place pour
-compiler une documentation des services corba à partir de commentaires se
-trouvant dans les fichiers idl. Nous rajouter donc à notre idl quelques
-commentaires, en respectant le formalisme doxygen.
-Un commentaire doxygen commence par "/<em>!" et se finit pas "</em>/".
-Pour structurer un minimum les pages générées, on les regroupes par module ou
-sujet. Dans notre exemple, nous utilisons la directive:</p>
-<pre class="literal-block">
-\ingroup EXAMPLES
-</pre>
-<p>spécifiant que la documentation générée fait partie du groupe EXAMPLES.
-(pour plus d'information sur doxygen, consulter le site www.doxygen.org).</p>
-<p>Pour finir, nous mettons à jour le Makefile avec le nouveau nom de composant:</p>
-<pre class="literal-block">
-IDL_FILES = HELLO_Gen.idl
-</pre>
-</div>
-<div class="section" id="impl-mentation-c">
-<h1><a class="toc-backref" href="#id5" name="impl-mentation-c">5 Implémentation C++</a></h1>
-<div class="section" id="les-sources">
-<h2><a class="toc-backref" href="#id6" name="les-sources">5.1 Les sources</a></h2>
-<p>L'implémentation C++ de notre module CORBA HELLO (interface idl HELLO_Gen) est faite dans le répertoire
-/src/HELLO:</p>
-<pre class="literal-block">
-HELLO.hxx
-HELLO.cxx
-</pre>
-<p>Au début du header de notre module (HELLO.hxx), les inclusions suivantes sont
-nécessaires:</p>
-<pre class="literal-block">
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(HELLO_Gen)
-#include "SALOME_Component_i.hxx"
-</pre>
-<p>Le fichier SALOMEconfig.h contient un certain nombre de définitions utiles
-pour assurer l'indépendance du code par rapport à la version de CORBA
-utilisée. SALOME_Component_i.hxx contient l'interface de la classe
-d'implémentation C++ du composant de base Salome (idl Engines::Component).
-Enfin, la macro CORBA_SERVER_HEADER assure l'indépendance des noms de fichiers
-d'inclusion par rapport à l'implémentation de l'ORB CORBA.</p>
-<p>Après cela, nous définissons une classe d'implémentation, nommée HELLO, dérivant de
-POA_HELLO_ORB::HELLO_Gen (classe abstraite générée automatiquement par CORBA lors de la
-compilation de l'idl) et de Engines_Component_i (car l'interface idl HELLO_Gen
-dérive de Engines::Component comme tout composant Salome2). Cette classe
-contient un constructeur dont les arguments sont imposés par CORBA, un
-destructeur virtuel, et une méthode makeBanner fournissant le service souhaité:</p>
-<pre class="literal-block">
-class HELLO:
- public POA_HELLO_ORB::HELLO_Gen,
- public Engines_Component_i
-{
-public:
- HELLO(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
- virtual ~HELLO();
- char* makeBanner(const char* name);
-};
-</pre>
-<p>La fonction makeBanner prend comme argument et renvoit un char*, projection C++ du type CORBA/IDL
-string.
-La documentation complète du mapping c++ de l'IDL est fournie par l'OMG sur
-son site internet : <a class="reference" href="http://www.omg.org/cgi-bin/doc?ptc/00-01-02">http://www.omg.org/cgi-bin/doc?ptc/00-01-02</a>.</p>
-<p>Enfin, nous fournissons l'interface (normalisé) de la fonction HELLOEngine_factory, qui
-sera appelée par le "FactoryServer C++" pour charger le composant HELLO:</p>
-<pre class="literal-block">
-extern "C"
- PortableServer::ObjectId * HELLOEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
-</pre>
-<p>Dans le fichier source (HELLO.cxx) se trouvent les définitions
-du constructeur et de la fonction d'instanciation
-HELLOEngine_factory (toutes deux normalisées!), et de makeBanner:</p>
-<pre class="literal-block">
-char* HELLO::makeBanner(const char* name)
-{
- string banner="Hello, ";
- banner+=name;
- return CORBA::string_dup(banner.c_str());
-}
-</pre>
-<p>Dans cette fonction, l'emploi de string_dup (fonction déclarée dans le
-namespace CORBA) n'est pas obligatoire (on aurait pu utiliser l'opérateur new),
-mais conseillé car ces fonctions permettent aux ORB d'utiliser des mécanismes
-spéciaux de gestion de la mémoire sans avoir à redéfinir les opérateurs new
-globaux.</p>
-</div>
-<div class="section" id="makefile">
-<h2><a class="toc-backref" href="#id7" name="makefile">5.2 Makefile</a></h2>
-<p>Dans le makefile, il faut définir certaines cibles:</p>
-<pre class="literal-block">
-VPATH=.:@srcdir@:@top_srcdir@/idl
-LIB = libHELLOEngine.la
-LIB_SRC = HELLO.cxx
-LIB_SERVER_IDL = HELLO_Gen.idl
-LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl Logger.idl
-CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS+= -lSalomeContainer -lOpUtil -L${KERNEL_ROOT_DIR}/lib/salome
-</pre>
-<p>Passons en revue chacune de ces cibles.
-- LIB contient le nom <em>normalisé</em> (lib<Nom_Module>Engine.la) le nom de la
-librairie, LIB_SRC définit le nom des fichiers sources, et VPATH les
-repertoire où l'on peut les trouver.
-- LIB_SERVER_IDL contient le nom des fichiers idl implémentés par le module.
-- LIB_CLIENT_IDL contient le nom des idl où sont définis les services CORBA
-utilisés par le module. HELLO utilise Logger.idl via les macros "MESSAGE",
-SALOME_Component.idl et SALOME_Exception.idl via l'héritage de HELLO_ORB::
-- Il faut ajouter à CPPFLAGS le chemin pour les fichiers includes utilisés
-(SALOMEconfig.h, SALOME_Component_i.hxx et utilities.h se trouvent dans
-${KERNEL_ROOT_DIR}/include/salome)::
-- La classe HELLO utilise les librairies lib (pour Engines_Component_i) et
-libOptUtil (pour PortableServer et Salome_Exception). On indique donc le nom
-de ces librairies et leur chemin dans LDFLAGS.
-D'autres librairies sont souvent utiles, par exemple libsalomeDS si on
-implémente la persistence, ou libSalomeNS si on utilise le naming service.</p>
-</div>
-</div>
-<div class="section" id="pilotage-du-composant-depuis-python-mode-tui">
-<h1><a class="toc-backref" href="#id8" name="pilotage-du-composant-depuis-python-mode-tui">6 Pilotage du composant depuis Python (mode TUI)</a></h1>
-<p>Lors de la compilation du module, la cible lib du Makefile dans /idl a
-provoqué la génération d'un stub python (souche côté client générée à partir
-de l'idl et offrant une interface dans le langage client - ici python.
-Concrètement, un module python HELLO_ORB contenant une classe
-_objref_HELLO_Gen sont créés, permettant de faire appel aux services de notre
-module C++ depuis python. Mettons ceci en application. Pour cela, nous lançons
-Salome en mode TUI:</p>
-<pre class="literal-block">
-cd $HELLO_ROOT_DIR/bin/salome
-python -i runSalome.py --modules=HELLO --xterm --logger --containers=cpp,python --killall
-</pre>
-<p>Depuis la fenêtre python, nous importons le module LifeCycle, et utilisons ses
-services pour charger notre composant Dans la conteneur C++ FactoryServer:</p>
-<pre class="literal-block">
->>> import LifeCycleCORBA
->>> lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
->>> import HELLO_ORB
->>> hello = lcc.FindOrLoadComponent("FactoryServer", "HELLO")
-</pre>
-<p>L'import de HELLO_ORB est nécessaire avant l'appel de FindOrLoadComponent,
-pour permettre de retourner un objet typé (opération de "narrowing"). Sinon,
-l'objet retourné est générique de type Engines::Component. Vérifions que notre
-objet hello est correctement typé, et appelons le service makeBanner:</p>
-<pre class="literal-block">
->>> print hello
-<HELLO_ORB._objref_HELLO_Gen instance at 0x8274e94>
->>> mybanner=hello.makeBanner("Nicolas")
->>> print mybanner
-Hello, Nicolas
-</pre>
-<p>Les commandes précédentes ont été regroupées dans la fonction test du script
-/bin/runSalome.py.</p>
-</div>
-<div class="section" id="interface-graphique">
-<h1><a class="toc-backref" href="#id9" name="interface-graphique">7 Interface graphique</a></h1>
-<div class="section" id="introduction">
-<h2><a class="toc-backref" href="#id10" name="introduction">7.1 Introduction</a></h2>
-<p>Pour aller plus loin dans l'intégration de notre module, nous allons ajouter
-une interface graphique (développée en Qt), s'intégrant dans l'interface
-applicative de Salome (IAPP).
-On ne détaillera pas ici le fonctionnement de l'IAPP de Salome, mais pour
-résumer, l'IAPP gère une boucle d'évènements (clics souris, clavier, etc), et
-redirige après traitement ces évènements vers le module actif (le principe est
-qu'à un instant donné, <em>un</em> module est actif. Lorsqu'un module est activé, son
-IHM est chargée dynamiquement).
-Le programmeur de la GUI d'un module a donc à charge de définir les méthodes
-permettant de traiter correctement les évènements transmis. Parmi ces
-méthodes, citons les principales : OnGUIEvent(), OnMousePress(), OnMouseMove(),
-OnKeyPress(), DefinePopup(), CustomPopup().</p>
-</div>
-<div class="section" id="choix-des-widgets">
-<h2><a class="toc-backref" href="#id11" name="choix-des-widgets">7.2 Choix des widgets</a></h2>
-<div class="section" id="description-xml">
-<h3><a class="toc-backref" href="#id12" name="description-xml">7.2.1 Description xml</a></h3>
-<p>La description des items de notre module se fait dans le fichier XML
-/ressources/HELLO_en.xml. Ce fichier est utilisé par l'IAPP pour charger
-dynamiquement l'IHM du module quand celle-ci est activée.
-Le principe est de définir par des balises les menus et boutons souhaités, et
-d'y associer des ID, qui seront récupérés par les fonctions gérant les
-évènemements IHM. Plusieures possibilités sont offertes:</p>
-<ul>
-<li><p class="first">ajout d'items à des menus déjà existant, auquel cas il faut reprendre les
-balises du menu pré-existant, et y ajouter les nouveaux items. Dans
-l'exemple qui suis, on ajoute le Menu <strong>Hello</strong> et l'item <strong>MyNewItem</strong> au
-menu File, dont l'ID vaut 1:</p>
-<pre class="literal-block">
-<menu-item label-id="File" item-id="1" pos-id="">
- <submenu label-id="Hello" item-id="19" pos-id="8">
- <popup-item item-id="190" pos-id="" label-id="MyNewItem" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
- <endsubmenu />
-</menu-item>
-</pre>
-</li>
-<li><p class="first">Création de nouveaux menus. Pour le module HELLO, nous ajoutons un menu
-HELLO, avec un unique item de label "Get banner":</p>
-<pre class="literal-block">
-<menubar>
- <menu-item label-id="HELLO" item-id="90" pos-id="3">
- <popup-item item-id="901" label-id="Get banner" icon-id="" tooltip-id="Get HELLO banner" accel-id="" toggle-id="" execute-action=""/>
- </menu-item>
-</menubar>
-</pre>
-</li>
-<li><p class="first">Ajout d'un bouton dans la barre à boutons. Dans l'exemple suivant, nous
-créons un deuxième point d'entrée pour notre action "Get banner", sous forme
-d'un bouton associé au même ID "901". L'icône est spécifiée par la le champ
-icon-id, qui doit être un fichier graphique 20x20 pixels au format png:</p>
-<pre class="literal-block">
-<toolbar label-id="HELLO">
- <toolbutton-item item-id="901" label-id="Get banner" icon-id="ExecHELLO.png"
-tooltip-id="Get HELLO banner" accel-id="" toggle-id="" execute-action=""/>
-</toolbar>
-</pre>
-</li>
-</ul>
-</div>
-<div class="section" id="convention">
-<h3><a class="toc-backref" href="#id13" name="convention">7.2.2 Convention</a></h3>
-<p>A chaque menu ou item est associé un ID. Les numéros entre 1 et 40 sont
-réservés à l'IAPP. Les numéros d'ID suivent une certaine règle, quoique
-celle-ci ne soit pas obligatoire. Au menu "HELLO" est associé l'ID 90. Son
-unique item "Get banner" a l'ID 901. Un deuxième item aurait l'ID 902, et un
-sous item l'ID 9021.</p>
-</div>
-</div>
-<div class="section" id="impl-mentation-de-l-ihm">
-<h2><a class="toc-backref" href="#id14" name="impl-mentation-de-l-ihm">7.3 Implémentation de l'IHM</a></h2>
-<p>L'implémentation C++ de l'IHM est faite dans le répertoire /src/HELLOGUI.
-Le header HELLOGUI.h déclare de la classe HELLOGUI, et
-contient des directives Qt (Q_OBJECT). De ce fait, il doit être processé par
-le compilateur moc (Qt Meta Model Compiler). Pour cette raison, l'extension du
-fichier est .h et dans le Makefile nous ajoutons la cible:</p>
-<pre class="literal-block">
-LIB_MOC = HELLOGUI.h
-</pre>
-<p>Le fichier source HELLO.cxx contient la définition des fonctions membres, et
-le Makefile permet de construire une librairie libHELLOGUI (le nom est
-normalisé poour permettre le chargement dynamique : lib<NomModule>GUI.</p>
-<div class="section" id="gestion-des-v-nements">
-<h3><a class="toc-backref" href="#id15" name="gestion-des-v-nements">7.3.1 Gestion des évènements</a></h3>
-<p>Pour l'IHM d'HELLO, nous définissons la fonction HELLOGUI::OnGUIEvent, qui
-sera appelé à chaque évènement. Cette fonction contient essentiellement une
-structure switch permettant de traiter l'ID reçu en argument:</p>
-<pre class="literal-block">
-switch (theCommandID)
- {
- case 901:
- // Traitement de "Get banner"
- ...
- case 190:
- // Traitement de "MyNewItem"
- ...
- }
-</pre>
-<p>Le traitement standard consiste à récupérer des données d'entrée (ici, le
-prénom via une fenêtre de dialogue QInputDialog::getText), à récupérer une
-poignée sur le composant CORBA interfacé afin d'appeler le service souhaité
-(ici, getBanner), et d'afficher le résultat obtenu ().</p>
-</div>
-<div class="section" id="classes-disponibles">
-<h3><a class="toc-backref" href="#id16" name="classes-disponibles">7.3.2 Classes disponibles</a></h3>
-<p>Pour les dialogues avec l'utilisateur, il est possible d'utiliser n'importe
-quelle classe fournie par Qt (<a class="reference" href="http://doc.trolltech.com/3.2/classes.html">http://doc.trolltech.com/3.2/classes.html</a>).
-Cependant, lorque c'eset possible, il est préférable d'utiliser les fonctions
-QAD (Qt Application Desktop), définies dans KERNEL_SRC/src/SALOMEGUI, qui
-encapsulent les fonctions Qt correspondantes et gèrent mieux les
-communications avec l'IAPP. Ainsi, dans HELLOGUI, nous utilisons la classe
-QAD_MessageBox en lieu et place de la classe Qt QMessageBox.</p>
-</div>
-<div class="section" id="gestion-du-multi-linguisme">
-<h3><a class="toc-backref" href="#id17" name="gestion-du-multi-linguisme">7.3.3 Gestion du multi-linguisme</a></h3>
-<p>Qt fournit un outil d'aide au support du multi-linguisme. Celui-ci est
-repris dans salome. Le principe est simple : toutes les chaînes de caractères
-utilisées pour les labels des menus et les dialogues avec l'utilisateur
-sont encapsulés dans des appels à la fonction Qt tr() (pour translate), qui
-prend en argument un nom de label. Par exemple, pour demander à l'utilisateur
-de rentrer un prénom, nous utilisons la fonction getText, où les deux premiers
-arguments sont des labels encapsulés par tr():</p>
-<pre class="literal-block">
-myName = QInputDialog::getText( tr("QUE_HELLO_LABEL"), tr("QUE_HELLO_NAME"),
- QLineEdit::Normal, QString::null, &ok);
-</pre>
-<p>Le nom des label est préfixé à titre indicatif par trois lettres et un underscore. Les codes
-suivants sont utilisés:</p>
-<pre class="literal-block">
-- MEN_ : label menu
-- BUT_ : label bouton
-- TOT_ : aide tooltip
-- ERR_ : message d'erreur
-- WRN_ : message d'alerte
-- INF_ : message d'information
-- QUE_ : question
-- PRP_ : prompt dans la barre des status
-</pre>
-<p>La traduction des labels encapsulés par tr() est faite pour différents
-langages cibles (par exemple français et anglais) dans des fichiers nommés "<nom_module>_msg_<langage>.po".
-<langage> correspond au code du langage, on a choisi <strong>en</strong> pour l'anglais et
-<strong>fr</strong> pour le français. Ce fichier doit contenir pour chaque clé sa
-traduction, par exemple:</p>
-<pre class="literal-block">
-msgid "HELLOGUI::INF_HELLO_BANNER"
-msgstr "HELLO Information"
-</pre>
-<p>Le squelette de ce fichier peut être généré par l'utilitaire Qt findtr:</p>
-<pre class="literal-block">
-findtr HELLOGUI.cxx > HELLO_msg_en.po
-</pre>
-<p>puis éditer le fichier HELLO_msg_en.po pour remplir les traductions.
-Ces fichiers sont ensuite compilés par l'utilitaire <strong>msg2qm</strong> pour générer
-des binaires <em>.qm</em>. Pour cela, il faut remplir la cible LIB_MOC dans le
-Makefile:</p>
-<pre class="literal-block">
-PO_FILES = HELLO_msg_en.po HELLO_msg_fr.po
-</pre>
-<p>Pour l'utilisateur final, le choix du langage se fait au niveau de chaque
-module dans le fichier ressources/config, en utilisant la commande:</p>
-<pre class="literal-block">
-langage=<langage>
-</pre>
-</div>
-</div>
-</div>
-<div class="section" id="r-gles-syntaxiques-de-nommage">
-<h1><a class="toc-backref" href="#id18" name="r-gles-syntaxiques-de-nommage">8 Règles syntaxiques de nommage</a></h1>
-<p>Dans ce qui précède, nous avons utilisé un certain nombre de règles de
-nommage. Le présent chapitre se propose de faire le point sur ces règles.
-Celles-ci ne sont pas toutes obligatoires, mais simplifient la compréhension
-si on les suit!</p>
-<table class="table" frame="border" rules="all">
-<colgroup>
-<col width="21%" />
-<col width="20%" />
-<col width="17%" />
-<col width="42%" />
-</colgroup>
-<thead valign="bottom">
-<tr><th>Règle</th>
-<th>Formalisme</th>
-<th>Exemple HELLO</th>
-<th>Commentaire</th>
-</tr>
-</thead>
-<tbody valign="top">
-<tr><td>Nom du module</td>
-<td><Module></td>
-<td>HELLO</td>
-<td>C'est le nom qui figure dans le
-catalogue des modules</td>
-</tr>
-<tr><td>Base CVS</td>
-<td><Module></td>
-<td>EXAMPLES</td>
-<td>Si la base cvs contient plusieurs
-modules, on prend un autre nom</td>
-</tr>
-<tr><td>Repertoire source</td>
-<td><Module>_SRC</td>
-<td>HELLO1_SRC</td>
-<td>L'indice 1 est utilisé car on prévoit
-plusieurs version du module</td>
-</tr>
-<tr><td>Fichier idl</td>
-<td><Module>_Gen.idl</td>
-<td>HELLO_Gen.idl</td>
-<td> </td>
-</tr>
-<tr><td>Nom du module
-CORBA</td>
-<td><Module>_ORB</td>
-<td>HELLO_ORB</td>
-<td>On évite d'utiliser le nom du module
-(conflits)</td>
-</tr>
-<tr><td>Nom de
-l'interface CORBA</td>
-<td><Module>_Gen</td>
-<td>HELLO_Gen</td>
-<td>La compilation de l'idl génère une
-classe abstraite
-POA_<Module>_ORB::<Module>_Gen</td>
-</tr>
-<tr><td>fichier source</td>
-<td><Module>.cxx</td>
-<td>HELLO.cxx</td>
-<td>Dans le répertoire /src/<Module></td>
-</tr>
-<tr><td>Classe
-d'implémentation</td>
-<td><Module></td>
-<td>HELLO</td>
-<td>Cette classe hérite de
-POA_HELLO_ORB::HELLO_Gen</td>
-</tr>
-<tr><td>Fonction
-d'instanciation</td>
-<td><Module>_
-Engine_factory</td>
-<td>HELLO_Engine
-factory</td>
-<td>Cette fonction est appelée par
-le FactoryServer de Salome</td>
-</tr>
-<tr><td>Catalogue des
-modules</td>
-<td><Module>Catalog
-.xml</td>
-<td>HELLOCatalog
-.xml</td>
-<td>Dans /ressources</td>
-</tr>
-<tr><td>Nom de la
-librairie C++</td>
-<td>lib<Module>Engine</td>
-<td>libHELLOEngine</td>
-<td>Dans le répertoire /src/<Module></td>
-</tr>
-<tr><td>Librairie C++
-de l'IHM</td>
-<td>lib<Module>GUI</td>
-<td>libHELLOGUI</td>
-<td>Dans le répertoire /src/<Module>GUI</td>
-</tr>
-<tr><td>Variable
-d'environnement</td>
-<td><Module>_ROOT_DIR</td>
-<td>HELLO_ROOT_DIR</td>
-<td> </td>
-</tr>
-<tr><td><p class="last">...</p>
-</td>
-<td><p class="last">...</p>
-</td>
-<td><p class="last">...</p>
-</td>
-<td><p class="last">...</p>
-</td>
-</tr>
-</tbody>
-</table>
-</div>
-</div>
-</body>
-</html>
+++ /dev/null
-===========================================================
-Guide pour le développement d'un module SALOME 2 en C++
-===========================================================
-
-:Auteur: Crouzet N.
-
-.. contents::
-.. sectnum::
-
-Présentation
-=========================
-Ce document a pour objectif de décrire les différentes étapes
-du développement d'un module SALOME 2 en C++.
-Il fait suite au document "Guide pour le développement d'un module SALOME 2 en
-Python", qui documente de module PYHELLO, et en reprend la démarche :
-construction pas à pas d'un module HELLO.
-Comme de nombreux points ne sont pas repris, il est recommendé de lire ce
-document préalablement.
-
-
-Les étapes de construction du module exemple
-====================================================
-Le composant choisi pour illustrer le processus de construction en C++
-est le même que celui choisi pour illustrer la construction du module python :
-il implémentera donc la même interface idl Corba.
-Il sera complété par un GUI graphique écrit en Qt.
-
-Les différentes étapes du développement seront les suivantes :
-
- - créer une arborescence de module
- - créer un composant SALOME 2 chargeable par un container C++
- - configurer le module pour que le composant soit connu de SALOME
- - ajouter un GUI graphique
- - rendre le composant utilisable dans le superviseur
-
-Création de l'arborescence du module
-=======================================
-Dans un premier temps, on se contentera de mettre dans le module exemple un composant
-SALOME écrit en C++ qui sera chargeable par un container C++.
-Il suffit donc d'une interface idl et d'une implantation C++ du composant.
-Pour mettre en oeuvre ceci dans un module SALOME 2, il nous faut reproduire l'arborescence de
-fichier standard suivante::
-
- + HELLO1_SRC
- + build_configure
- + configure.in.base
- + Makefile.in
- + adm_local
- + unix
- + make_commence.in
- + make_omniorb.in
- + config_files
- + bin
- + VERSION
- + runAppli.in
- + runSalome.py
- + idl
- + Makefile.in
- + HELLO_Gen.idl
- + src
- + Makefile.in
- + HELLO
- + Makefile.in
- + HELLO.cxx
- + HELLO.hxx
- + doc
-
-Pour cela, on recopie l'arborescence de PYHELLO, et on modifie où nécessaire
-PYHELLO en HELLO::
-
- cp -r PYHELLO1_SRC HELLO1_SRC
- cd HELLO1_SRC
- mv idl/PYHELLO_Gen.idl idl/HELLO_Gen.idl
- mv src/PYHELLO src/HELLO
-
-
-Interface idl
-==================
-Dans le répertoire idl, nous modifions le fichier idl HELLO_Gen.idl : le
-module défini est renommé HELLO_ORB, et l'interface en HELLO_Gen.
-Le service rendu reste le même : à partir d'une chaine de caractères
-fournie comme unique argument, retour d'une chaine de caractères obtenue
-par concaténation de "Hello, " et de la chaine d'entrée.
-Ce service est spécifié par la fonction makeBanner.
-
-Un utilitaire de documentation basé sur doxygen a été mis en place pour
-compiler une documentation des services corba à partir de commentaires se
-trouvant dans les fichiers idl. Nous rajouter donc à notre idl quelques
-commentaires, en respectant le formalisme doxygen.
-Un commentaire doxygen commence par "/*!" et se finit pas "*/".
-Pour structurer un minimum les pages générées, on les regroupes par module ou
-sujet. Dans notre exemple, nous utilisons la directive::
-
- \ingroup EXAMPLES
-
-spécifiant que la documentation générée fait partie du groupe EXAMPLES.
-(pour plus d'information sur doxygen, consulter le site www.doxygen.org).
-
-Pour finir, nous mettons à jour le Makefile avec le nouveau nom de composant::
-
- IDL_FILES = HELLO_Gen.idl
-
-
-Implémentation C++
-==================
-
-Les sources
------------
-
-L'implémentation C++ de notre module CORBA HELLO (interface idl HELLO_Gen) est faite dans le répertoire
-/src/HELLO::
-
- HELLO.hxx
- HELLO.cxx
-
-Au début du header de notre module (HELLO.hxx), les inclusions suivantes sont
-nécessaires::
-
- #include <SALOMEconfig.h>
- #include CORBA_SERVER_HEADER(HELLO_Gen)
- #include "SALOME_Component_i.hxx"
-
-Le fichier SALOMEconfig.h contient un certain nombre de définitions utiles
-pour assurer l'indépendance du code par rapport à la version de CORBA
-utilisée. SALOME_Component_i.hxx contient l'interface de la classe
-d'implémentation C++ du composant de base Salome (idl Engines::Component).
-Enfin, la macro CORBA_SERVER_HEADER assure l'indépendance des noms de fichiers
-d'inclusion par rapport à l'implémentation de l'ORB CORBA.
-
-Après cela, nous définissons une classe d'implémentation, nommée HELLO, dérivant de
-POA_HELLO_ORB::HELLO_Gen (classe abstraite générée automatiquement par CORBA lors de la
-compilation de l'idl) et de Engines_Component_i (car l'interface idl HELLO_Gen
-dérive de Engines::Component comme tout composant Salome2). Cette classe
-contient un constructeur dont les arguments sont imposés par CORBA, un
-destructeur virtuel, et une méthode makeBanner fournissant le service souhaité::
-
- class HELLO:
- public POA_HELLO_ORB::HELLO_Gen,
- public Engines_Component_i
- {
- public:
- HELLO(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
- virtual ~HELLO();
- char* makeBanner(const char* name);
- };
-
-La fonction makeBanner prend comme argument et renvoit un char*, projection C++ du type CORBA/IDL
-string.
-La documentation complète du mapping c++ de l'IDL est fournie par l'OMG sur
-son site internet : http://www.omg.org/cgi-bin/doc?ptc/00-01-02.
-
-Enfin, nous fournissons l'interface (normalisé) de la fonction HELLOEngine_factory, qui
-sera appelée par le "FactoryServer C++" pour charger le composant HELLO::
-
- extern "C"
- PortableServer::ObjectId * HELLOEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
-
-Dans le fichier source (HELLO.cxx) se trouvent les définitions
-du constructeur et de la fonction d'instanciation
-HELLOEngine_factory (toutes deux normalisées!), et de makeBanner::
-
- char* HELLO::makeBanner(const char* name)
- {
- string banner="Hello, ";
- banner+=name;
- return CORBA::string_dup(banner.c_str());
- }
-
-Dans cette fonction, l'emploi de string_dup (fonction déclarée dans le
-namespace CORBA) n'est pas obligatoire (on aurait pu utiliser l'opérateur new),
-mais conseillé car ces fonctions permettent aux ORB d'utiliser des mécanismes
-spéciaux de gestion de la mémoire sans avoir à redéfinir les opérateurs new
-globaux.
-
-Makefile
---------
-
-Dans le makefile, il faut définir certaines cibles::
-
- VPATH=.:@srcdir@:@top_srcdir@/idl
- LIB = libHELLOEngine.la
- LIB_SRC = HELLO.cxx
- LIB_SERVER_IDL = HELLO_Gen.idl
- LIB_CLIENT_IDL = SALOME_Component.idl SALOME_Exception.idl Logger.idl
- CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome
- LDFLAGS+= -lSalomeContainer -lOpUtil -L${KERNEL_ROOT_DIR}/lib/salome
-
-Passons en revue chacune de ces cibles.
-- LIB contient le nom *normalisé* (lib<Nom_Module>Engine.la) le nom de la
-librairie, LIB_SRC définit le nom des fichiers sources, et VPATH les
-repertoire où l'on peut les trouver.
-- LIB_SERVER_IDL contient le nom des fichiers idl implémentés par le module.
-- LIB_CLIENT_IDL contient le nom des idl où sont définis les services CORBA
-utilisés par le module. HELLO utilise Logger.idl via les macros "MESSAGE",
-SALOME_Component.idl et SALOME_Exception.idl via l'héritage de HELLO_ORB::
-- Il faut ajouter à CPPFLAGS le chemin pour les fichiers includes utilisés
-(SALOMEconfig.h, SALOME_Component_i.hxx et utilities.h se trouvent dans
-${KERNEL_ROOT_DIR}/include/salome)::
-- La classe HELLO utilise les librairies lib (pour Engines_Component_i) et
-libOptUtil (pour PortableServer et Salome_Exception). On indique donc le nom
-de ces librairies et leur chemin dans LDFLAGS.
-D'autres librairies sont souvent utiles, par exemple libsalomeDS si on
-implémente la persistence, ou libSalomeNS si on utilise le naming service.
-
-
-Pilotage du composant depuis Python (mode TUI)
-==============================================
-
-Lors de la compilation du module, la cible lib du Makefile dans /idl a
-provoqué la génération d'un stub python (souche côté client générée à partir
-de l'idl et offrant une interface dans le langage client - ici python.
-Concrètement, un module python HELLO_ORB contenant une classe
-_objref_HELLO_Gen sont créés, permettant de faire appel aux services de notre
-module C++ depuis python. Mettons ceci en application. Pour cela, nous lançons
-Salome en mode TUI::
-
- cd $HELLO_ROOT_DIR/bin/salome
- python -i runSalome.py --modules=HELLO --xterm --logger --containers=cpp,python --killall
-
-Depuis la fenêtre python, nous importons le module LifeCycle, et utilisons ses
-services pour charger notre composant Dans la conteneur C++ FactoryServer::
-
- >>> import LifeCycleCORBA
- >>> lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
- >>> import HELLO_ORB
- >>> hello = lcc.FindOrLoadComponent("FactoryServer", "HELLO")
-
-L'import de HELLO_ORB est nécessaire avant l'appel de FindOrLoadComponent,
-pour permettre de retourner un objet typé (opération de "narrowing"). Sinon,
-l'objet retourné est générique de type Engines::Component. Vérifions que notre
-objet hello est correctement typé, et appelons le service makeBanner::
-
- >>> print hello
- <HELLO_ORB._objref_HELLO_Gen instance at 0x8274e94>
- >>> mybanner=hello.makeBanner("Nicolas")
- >>> print mybanner
- Hello, Nicolas
-
-Les commandes précédentes ont été regroupées dans la fonction test du script
-/bin/runSalome.py.
-
-
-Interface graphique
-===================
-
-Introduction
-------------
-
-Pour aller plus loin dans l'intégration de notre module, nous allons ajouter
-une interface graphique (développée en Qt), s'intégrant dans l'interface
-applicative de Salome (IAPP).
-On ne détaillera pas ici le fonctionnement de l'IAPP de Salome, mais pour
-résumer, l'IAPP gère une boucle d'évènements (clics souris, clavier, etc), et
-redirige après traitement ces évènements vers le module actif (le principe est
-qu'à un instant donné, *un* module est actif. Lorsqu'un module est activé, son
-IHM est chargée dynamiquement).
-Le programmeur de la GUI d'un module a donc à charge de définir les méthodes
-permettant de traiter correctement les évènements transmis. Parmi ces
-méthodes, citons les principales : OnGUIEvent(), OnMousePress(), OnMouseMove(),
-OnKeyPress(), DefinePopup(), CustomPopup().
-
-Choix des widgets
------------------
-
-Description xml
-```````````````
-La description des items de notre module se fait dans le fichier XML
-/ressources/HELLO_en.xml. Ce fichier est utilisé par l'IAPP pour charger
-dynamiquement l'IHM du module quand celle-ci est activée.
-Le principe est de définir par des balises les menus et boutons souhaités, et
-d'y associer des ID, qui seront récupérés par les fonctions gérant les
-évènemements IHM. Plusieures possibilités sont offertes:
-
-- ajout d'items à des menus déjà existant, auquel cas il faut reprendre les
- balises du menu pré-existant, et y ajouter les nouveaux items. Dans
- l'exemple qui suis, on ajoute le Menu **Hello** et l'item **MyNewItem** au
- menu File, dont l'ID vaut 1::
-
- <menu-item label-id="File" item-id="1" pos-id="">
- <submenu label-id="Hello" item-id="19" pos-id="8">
- <popup-item item-id="190" pos-id="" label-id="MyNewItem" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
- </submenu>
- <endsubmenu />
- </menu-item>
-
-- Création de nouveaux menus. Pour le module HELLO, nous ajoutons un menu
- HELLO, avec un unique item de label "Get banner"::
-
- <menubar>
- <menu-item label-id="HELLO" item-id="90" pos-id="3">
- <popup-item item-id="901" label-id="Get banner" icon-id="" tooltip-id="Get HELLO banner" accel-id="" toggle-id="" execute-action=""/>
- </menu-item>
- </menubar>
-
-- Ajout d'un bouton dans la barre à boutons. Dans l'exemple suivant, nous
- créons un deuxième point d'entrée pour notre action "Get banner", sous forme
- d'un bouton associé au même ID "901". L'icône est spécifiée par la le champ
- icon-id, qui doit être un fichier graphique 20x20 pixels au format png::
-
- <toolbar label-id="HELLO">
- <toolbutton-item item-id="901" label-id="Get banner" icon-id="ExecHELLO.png"
- tooltip-id="Get HELLO banner" accel-id="" toggle-id="" execute-action=""/>
- </toolbar>
-
-Convention
-``````````
-A chaque menu ou item est associé un ID. Les numéros entre 1 et 40 sont
-réservés à l'IAPP. Les numéros d'ID suivent une certaine règle, quoique
-celle-ci ne soit pas obligatoire. Au menu "HELLO" est associé l'ID 90. Son
-unique item "Get banner" a l'ID 901. Un deuxième item aurait l'ID 902, et un
-sous item l'ID 9021.
-
-
-Implémentation de l'IHM
------------------------
-
-L'implémentation C++ de l'IHM est faite dans le répertoire /src/HELLOGUI.
-Le header HELLOGUI.h déclare de la classe HELLOGUI, et
-contient des directives Qt (Q_OBJECT). De ce fait, il doit être processé par
-le compilateur moc (Qt Meta Model Compiler). Pour cette raison, l'extension du
-fichier est .h et dans le Makefile nous ajoutons la cible::
-
- LIB_MOC = HELLOGUI.h
-
-Le fichier source HELLO.cxx contient la définition des fonctions membres, et
-le Makefile permet de construire une librairie libHELLOGUI (le nom est
-normalisé poour permettre le chargement dynamique : lib<NomModule>GUI.
-
-Gestion des évènements
-``````````````````````
-Pour l'IHM d'HELLO, nous définissons la fonction HELLOGUI::OnGUIEvent, qui
-sera appelé à chaque évènement. Cette fonction contient essentiellement une
-structure switch permettant de traiter l'ID reçu en argument::
-
- switch (theCommandID)
- {
- case 901:
- // Traitement de "Get banner"
- ...
- case 190:
- // Traitement de "MyNewItem"
- ...
- }
-
-Le traitement standard consiste à récupérer des données d'entrée (ici, le
-prénom via une fenêtre de dialogue QInputDialog::getText), à récupérer une
-poignée sur le composant CORBA interfacé afin d'appeler le service souhaité
-(ici, getBanner), et d'afficher le résultat obtenu ().
-
-Classes disponibles
-````````````````````
-Pour les dialogues avec l'utilisateur, il est possible d'utiliser n'importe
-quelle classe fournie par Qt (http://doc.trolltech.com/3.2/classes.html).
-Cependant, lorque c'eset possible, il est préférable d'utiliser les fonctions
-QAD (Qt Application Desktop), définies dans KERNEL_SRC/src/SALOMEGUI, qui
-encapsulent les fonctions Qt correspondantes et gèrent mieux les
-communications avec l'IAPP. Ainsi, dans HELLOGUI, nous utilisons la classe
-QAD_MessageBox en lieu et place de la classe Qt QMessageBox.
-
-
-Gestion du multi-linguisme
-``````````````````````````
-Qt fournit un outil d'aide au support du multi-linguisme. Celui-ci est
-repris dans salome. Le principe est simple : toutes les chaînes de caractères
-utilisées pour les labels des menus et les dialogues avec l'utilisateur
-sont encapsulés dans des appels à la fonction Qt tr() (pour translate), qui
-prend en argument un nom de label. Par exemple, pour demander à l'utilisateur
-de rentrer un prénom, nous utilisons la fonction getText, où les deux premiers
-arguments sont des labels encapsulés par tr()::
-
- myName = QInputDialog::getText( tr("QUE_HELLO_LABEL"), tr("QUE_HELLO_NAME"),
- QLineEdit::Normal, QString::null, &ok);
-
-Le nom des label est préfixé à titre indicatif par trois lettres et un underscore. Les codes
-suivants sont utilisés::
-
- - MEN_ : label menu
- - BUT_ : label bouton
- - TOT_ : aide tooltip
- - ERR_ : message d'erreur
- - WRN_ : message d'alerte
- - INF_ : message d'information
- - QUE_ : question
- - PRP_ : prompt dans la barre des status
-
-
-La traduction des labels encapsulés par tr() est faite pour différents
-langages cibles (par exemple français et anglais) dans des fichiers nommés "<nom_module>_msg_<langage>.po".
-<langage> correspond au code du langage, on a choisi **en** pour l'anglais et
-**fr** pour le français. Ce fichier doit contenir pour chaque clé sa
-traduction, par exemple::
-
- msgid "HELLOGUI::INF_HELLO_BANNER"
- msgstr "HELLO Information"
-
-Le squelette de ce fichier peut être généré par l'utilitaire Qt findtr::
-
- findtr HELLOGUI.cxx > HELLO_msg_en.po
-
-puis éditer le fichier HELLO_msg_en.po pour remplir les traductions.
-Ces fichiers sont ensuite compilés par l'utilitaire **msg2qm** pour générer
-des binaires *.qm*. Pour cela, il faut remplir la cible LIB_MOC dans le
-Makefile::
-
- PO_FILES = HELLO_msg_en.po HELLO_msg_fr.po
-
-Pour l'utilisateur final, le choix du langage se fait au niveau de chaque
-module dans le fichier ressources/config, en utilisant la commande::
-
- langage=<langage>
-
-
-
-Règles syntaxiques de nommage
-=============================
-
-Dans ce qui précède, nous avons utilisé un certain nombre de règles de
-nommage. Le présent chapitre se propose de faire le point sur ces règles.
-Celles-ci ne sont pas toutes obligatoires, mais simplifient la compréhension
-si on les suit!
-
-+-------------------+------------------+----------------+---------------------------------------+
-| Règle | Formalisme | Exemple HELLO | Commentaire |
-+===================+==================+================+=======================================+
-| Nom du module | <Module> | HELLO | C'est le nom qui figure dans le |
-| | | | catalogue des modules |
-+-------------------+------------------+----------------+---------------------------------------+
-| Base CVS | <Module> | EXAMPLES | Si la base cvs contient plusieurs |
-| | | | modules, on prend un autre nom |
-+-------------------+------------------+----------------+---------------------------------------+
-| Repertoire source | <Module>_SRC | HELLO1_SRC | L'indice 1 est utilisé car on prévoit |
-| | | | plusieurs version du module |
-+-------------------+------------------+----------------+---------------------------------------+
-| Fichier idl | <Module>_Gen.idl | HELLO_Gen.idl | |
-| | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-| Nom du module | <Module>_ORB | HELLO_ORB | On évite d'utiliser le nom du module |
-| CORBA | | | (conflits) |
-+-------------------+------------------+----------------+---------------------------------------+
-| Nom de | <Module>_Gen | HELLO_Gen | La compilation de l'idl génère une |
-| l'interface CORBA | | | classe abstraite |
-| | | | POA_<Module>_ORB::<Module>_Gen |
-+-------------------+------------------+----------------+---------------------------------------+
-| fichier source | <Module>.cxx | HELLO.cxx | Dans le répertoire /src/<Module> |
-| | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-| Classe | <Module> | HELLO | Cette classe hérite de |
-| d'implémentation | | | POA_HELLO_ORB::HELLO_Gen |
-+-------------------+------------------+----------------+---------------------------------------+
-| Fonction | <Module>_ | HELLO_Engine | Cette fonction est appelée par |
-| d'instanciation | Engine_factory | factory | le FactoryServer de Salome |
-+-------------------+------------------+----------------+---------------------------------------+
-| Catalogue des | <Module>Catalog | HELLOCatalog | Dans /ressources |
-| modules | .xml | .xml | |
-+-------------------+------------------+----------------+---------------------------------------+
-| Nom de la | lib<Module>Engine| libHELLOEngine | Dans le répertoire /src/<Module> |
-| librairie C++ | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-| Librairie C++ | lib<Module>GUI | libHELLOGUI | Dans le répertoire /src/<Module>GUI |
-| de l'IHM | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-| Variable | <Module>_ROOT_DIR| HELLO_ROOT_DIR | |
-| d'environnement | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-| ... | ... | ... | ... |
-| | | | |
-+-------------------+------------------+----------------+---------------------------------------+
-
--- /dev/null
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# 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
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "HELLO sample module reference manual v.@VERSION@"
+OUTPUT_DIRECTORY = .
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+TAB_SIZE = 5
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+
+#---------------------------------------------------------------------------
+#Input related options
+#---------------------------------------------------------------------------
+INPUT = @srcdir@
+FILE_PATTERNS = *.doc
+EXCLUDE =
+IMAGE_PATH = @srcdir@/images
+EXAMPLE_PATH =
+
+#---------------------------------------------------------------------------
+#HTML related options
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = .
+HTML_HEADER = @builddir@/static/header.html
+HTML_FOOTER = @srcdir@/static/footer.html
+HTML_STYLESHEET = @srcdir@/static/doxygen.css
+TOC_EXPAND = YES
+DISABLE_INDEX = NO
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 300
+
+#---------------------------------------------------------------------------
+#SORT related options
+#---------------------------------------------------------------------------
+SORT_GROUP_NAMES = NO
+
+
+#---------------------------------------------------------------------------
+#LaTeX related option
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+
+#---------------------------------------------------------------------------
+#RTF related options
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+
+#---------------------------------------------------------------------------
+#External reference options
+#---------------------------------------------------------------------------
+TAGFILES =
+ALLEXTERNALS = NO
+SEARCHENGINE = NO
--- /dev/null
+/*!
+
+\mainpage Introduction to HELLO sample module
+
+The purpose of the \b HELLO module is to describe briefly the different
+steps in the development of a SALOME module in C++.
+
+Contents:
+- \subpage dev_steps
+- \subpage tree_structure
+- \subpage build_proc_files
+- \subpage idl_dir
+- \subpage src_dir
+- \subpage bin_dir
+- \subpage doc_dir
+- \subpage build_procedure
+- \subpage run_procedure
+- \subpage load_module
+- \subpage catalog_def
+- \subpage load_lcc
+- \subpage load_iapp
+
+\ref dev_steps ">> Next"
+
+\page dev_steps Steps in construction of the example module
+
+The example module chosen to illustrate the process of SALOME module
+development is very simple. The module contains a single
+component and this component provides several services called \b
+hello and \b goodbye.
+Each of these functions accepts a reference to the SALOME study and
+a character string as the arguments and returns the status of the operation.
+The component also provides a simple GUI.
+
+The steps in the development are as follows:
+- create a module tree structure
+- create a SALOME component that can be loaded by a C++ SALOME container
+- configure the module so that the component is known to SALOME
+- add a GUI
+
+\ref index "<< Previous"<br>\ref tree_structure ">> Next"
+
+\page tree_structure Create the module tree structure
+
+The first step in the development process is the creation of the
+module tree file hierarchy. The typical SALOME module usually includes
+some set of the configuration files (used in the build procedure of a
+module), Makefiles, IDL file that provides a definition of a CORBA
+services implemented in a module and a set of source files which are
+compiled by the build procedure to the module CORBA engine library and
+(optionally) GUI library.
+
+The following file structure is typical for the SALOME module:
+
+<pre>
++ HELLO1_SRC
+ + build_configure
+ + clean_configure
+ + configure.ac
+ + Makefile.am
+ + HELLO_version.h.in
+ + AUTHORS
+ + COPYING
+ + ChangeLog
+ + INSTALL
+ + NEWS
+ + README
+ + adm_local
+ + Makefile.am
+ + unix
+ + Makefile.am
+ + make_common_starter.am
+ + config_files
+ + Makefile.am
+ + check_GUI.m4
+ + check_HELLO.m4
+ + bin
+ + Makefile.am
+ + VERSION.in
+ + runAppli.in
+ + myrunSalome.py
+ + idl
+ + Makefile.am
+ + HELLO_Gen.idl
+ + src
+ + Makefile.am
+ + HELLO
+ + Makefile.am
+ + HELLO.hxx
+ + HELLO.cxx
+ + HELLOGUI
+ + Makefile.am
+ + HELLOGUI.h
+ + HELLOGUI.cxx
+ + HELLO_msg_en.ts
+ + HELLO_icons.ts
+ + resources
+ + Makefile.am
+ + HELLO.png
+ + goodbye.png
+ + handshake.png
+ + testme.png
+ + HELLOCatalog.xml.in
+ + SalomeApp.xml.in
+ + doc
+ + Makefile.am
+ + doxyfile.in
+ + index.doc
+ + images
+ + head.png
+ + static
+ + doxygen.css
+ + footer.html
+ + header.html.in
+</pre>
+
+Note that other files can be optionally present.
+
+The usual way of the sources directory tree structure initial creation
+is to copy it from the existing SALOME module.
+
+\warning The files of the platform base module (KERNEL) must not be
+copied to initialise a module tree structure. It is usually preferable
+to copy files from another module such as GEOM or MED.
+
+The module name is HELLO, the component name is HELLO and all the
+files are put in a directory named HELLO1_SRC.
+Below is a short description of these files. Note, that files with .in
+suffix are the autoconf templates from which the actual files are
+generated during the build procedure.
+
+- \c build_configure
+- \c configure.ac
+- \c Makefile.am
+- \c make_common_starter.am
+- \c clean_configure
+
+These files are a part of the build system based on GNU
+automake/autoconf auto-tools. These files define the build procedure,
+namely, compilation and installation rules like compiler and linker
+options, installation destination folder, package version etc.
+
+- \c AUTHORS
+- \c COPYING
+- \c ChangeLog
+- \c INSTALL
+- \c NEWS
+- \c README
+
+These files are also a usual part of the GNU auto-tools based build
+procedure. These files are used by developers to provide an additional
+information on a product, like license, authors and distribution
+information, change log between versions of a product, installation
+hints, etc.
+
+- \c HELLO_version.h.in
+
+This is an optional C++ header file, specifying the version
+macro-definitions which can be used, for example, in other modules to
+check the version of the SALOME module (HELLO module in this
+case).
+
+- \c adm_local
+
+This directory contains additional administrative files used by the
+build procedure.
+
+- \c adm_local/unix/config_files/check_GUI.m4
+- \c adm_local/unix/config_files/check_HELLO.m4
+
+These files are another part of the GNU auto-tools based build
+procedure. The scripts written in m4 language are usually used to test
+an availability of some 3rd-party pre-requisite product, compiler
+feature, different configuration options. For example, check_GUI.m4
+file provides a procedure to test availability of SALOME GUI
+module and thus specify if GUI library of HELLO module should be built
+or no.
+
+- \c bin
+
+This directory usually contains different scripts.
+
+- \c bin/VERSION.in
+
+This file is used to document the module, it must give its version (at
+least) and (optionally) compatibilities or incompatibilities with
+other modules. This file is strongly recommended but is not essential
+for operation of the module.
+
+- \c bin/runAppli.in
+- \c bin/myrunSalome.py
+
+These files are not essential but make the example easier to
+use. These are scripts that can be used to run SALOME session with
+HELLO module.
+
+- \c idl
+
+This directory contains IDL files that specify the CORBA services
+supplied by SALOME module.
+
+- \c idl/HELLO_Gen.idl
+
+This is the CORBA IDL definition of the services implemented by SALOME
+HELLO module.
+
+- \c src
+
+This is a root directory of the module source codes. Usually it contains
+one or more sub-directories that provide an implementation of module
+libraries, executables, Python API modules, etc. The hierarchy of the
+sources tree is arbitrary; it follows the specific module needs.
+
+- \c src/HELLO
+
+This directory provides implementation of engine library.
+
+- \c src/HELLO/HELLO.hxx
+- \c src/HELLO/HELLO.cxx
+
+These files provide the implementation of a CORBA engine library of
+the HELLO module. In particular, this is an implementation of the
+services defined in the \c HELLO_Gen.idl file.
+
+- \c HELLOGUI
+
+It is an optional directory that provides an implementation of HELLO
+module's GUI library.
+
+Strictly speaking, the GUI library is optional for each SALOME module.
+In some cases it's enough to implement CORBA engine only. Then,
+the services of the module will be avaiable in a CORBA environment.
+The module can be loaded to the SALOME container and its services
+can be used in the SALOME supervision computation schemas, in Python
+scripts or/and in C++ implementation of other modules.
+
+A GUI library is necessary only if it is planned to access the module
+functionality from the SALOME GUI session via menu actions, dialog boxes
+and so on.
+
+- \c src/HELLOGUI/HELLOGUI.h
+- \c src/HELLOGUI/HELLOGUI.cxx
+
+These files provide the implementation of a GUI library of
+the HELLO module. In particular, these files specify menus, toolbars,
+dialog boxes and other such staff.
+
+- \c src/HELLOGUI/HELLO_msg_en.ts
+- \c src/HELLOGUI/HELLO_icons.ts
+
+These files provide a description (internationalization) of GUI
+resources of the HELLO module. \c HELLO_msg_en.ts provides an English
+translation of the string resources used in a module (there can be also
+translation files for other languages, for instance French; these files
+are distinguished by the language suffix). \c HELLO_icons.ts
+defines images and icons resources used within the GUI library of
+HELLO module. Please refer to Qt linguist documentation for more
+details.
+
+- \c resources
+
+This optional directory usually contains different resources files
+required for the correct operation of SALOME module.
+
+- \c resources/HELLO.png
+- \c resources/handshake.png
+- \c resources/goodbye.png
+- \c resources/testme.png
+
+These are different module icon files. \c HELLO.png file provides main icon
+of HELLO module to be shown in the SALOME GUI desktop. Other files are
+the icons for the functions implemented by the module; they are used
+in the menus and toolbars.
+
+- \c resources/HELLOCatalog.xml.in
+
+The XML description of the CORBA services provided by the HELLO
+module. This file is parsed by SALOME supervision module (YACS) to generate
+the list of service nodes to be used in the calculation schemas. The
+simplest way to create this file is to use Catalog Generator utility
+provided by the SALOME KERNEL module, that can automatically generate
+XML description file from the IDL file. In GUI, this utility is available
+via the Tools main menu.
+
+- \c resources/SalomeApp.xml.in
+
+This file is essential for each SALOME module. It provides some parameters of
+the module which define its behavior in SALOME. In particular it
+should provide a section with the name corresponding to the name of a
+module ("HELLO" in our case) with the following parameters:
+\code
+ <section name="HELLO">
+ <parameter name="name" value="Hello"/>
+ <parameter name="icon" value="HELLO.png"/>
+ <parameter name="version" value="@VERSION@"/>
+ <parameter name="documentation" value="hello_help"/>
+ </section>
+\endcode
+
+The \a "name" parameter defines GUI name of a module. The \a "icon"
+parameter defines a GUI icon of a module. Optional \a "version" parameter
+defines the version fo the module. The \a "documentation" parameter
+provides a name for the help-related resource section (see below).
+
+The section \a "resources" of a file specifies the directory that contains
+resources of a module (icons, translation files, etc).
+
+\code
+ <section name="resources">
+ <parameter name="HELLO" value="%HELLO_ROOT_DIR%/share/salome/resources/hello"/>
+ </section>
+\endcode
+
+The section \a "hello_help" provides information on the location of
+the help page(s) and the eventual sub-menu in the Help menu. The name of this section
+can be arbitrary, in such a case it should be specified in the main module's resources
+section (see above). Alternatively, this section's name can have syntax
+\a "<module_name>_documentation", where \a module_name is a name of the module.
+If such section is present in the resource file, it is not necessary to specify it
+in the module's main section.
+
+Parameter \a "sub_menu" of the documentation section allows sepecifying the name of the
+sub-menu in the Help main menu where the documentation materials of a module should be
+put.
+
+\code
+ <section name="hello_help" >
+ <parameter name="sub_menu" value="Samples"/>
+ <parameter name="%1 User's Guide" value="%HELLO_ROOT_DIR%/share/doc/salome/gui/HELLO/index.html"/>
+ </section>
+\endcode
+
+- \c doc
+
+This directory containes the files related to the module's documentation.
+
+- \c doc/doxyfile.in
+
+The \b Doxygen configuration file. The Doxygen is used to build this
+documentation. The file \c doxyfile.in provides a rules for the
+generation of module documentation.
+
+- \c doc/index.doc
+
+An input file for the Doxygen, which provides a source of this documentation.
+
+- \c doc/images
+
+This sub-folder contains images used in the documentation.
+
+- \c doc/static
+
+This sub-folder contains auxiliary files used when generating documentation
+by Doxygen, like header (\c header.html.in) and footer (\c footer.html)
+of the HTML pages, style sheet (\c doxygen.css) etc.
+
+\ref dev_steps "<< Previous"<br>\ref build_proc_files ">> Next"
+
+\page build_proc_files Build procedure input files
+
+In most cases SALOME uses \b autoconf, \b automake and other GNU auto-tools
+to build the modules. The \c configure script is used for the build procedure
+to test the system configuration and to pre-configure the module construction
+\c Makefile files.
+
+The \c build_configure script provides a procedure that uses
+\c configure.ac and set of \c Makefile.am files as input and uses \b autoconf
+to generate the \c configure script and \b automake to generate \c Makefile.in
+files.
+
+The files with an \c .in extension are the skeletons that are the input
+of the \c configure script (to be more precise, these files should be
+listed in the end of the \c configure.ac file in the \c AC_OUTPUT()
+autoconf macro) and are transformed to the resulting files during the
+configuration process.
+
+Almost all files used for this process are located in SALOME
+base module KERNEL that is referenced by the \c KERNEL_ROOT_DIR
+environment variable, namely in its \c salome_adm sub-folder.
+Similarly, the \c GUI_ROOT_DIR environment variable is used for the
+graphical user interface (GUI) module of SALOME; this module also
+provides a set of configuration utilities (m4 files) in its
+\c adm_local folder. However, some files must be modified as a
+function of the target module. This is the case for \c build_configure
+and \c configure.ac files which usually need to be adapted to the module needs.
+
+The file \c make_common_starter.am file in the \c adm_local directory of
+the HELLO module provides basic build rules to be used in other
+\c Makefile.am files. To refer to this file in any \c Makefile.am it is
+necessary to use \a "include" clause:
+
+\code
+include $(top_srcdir)/adm_local/unix/make_common_starter.am
+\endcode
+
+The \c adm_local/unix/config_files is a directory in which the m4 files
+that are used to test the configuration of the system in the configuration
+process can be placed. If the \c salome_adm files are not sufficient,
+additional configuration files can be put to the \c adm_local directory.
+
+\ref tree_structure "<< Previous"<br>\ref idl_dir ">> Next"
+
+\page idl_dir The idl directory
+
+The \c idl directory requires a \c Makefile.am that must make the
+compilation of the CORBA IDL \c HELLO_Gen.idl file and install all the
+generated files into the correct module installation directories. The
+\a BASEIDL_FILES target has to be modified to reach this goal.
+
+The IDL file itself must define a CORBA component for which the name must
+be different from the module name to avoid name conflicts and define a
+CORBA interface that is derived at least from the \a EngineComponent interface
+of the \a Engines module. In case of HELLO module, the name of the CORBA
+component is \b HELLO_ORB and the name of the interface is \b HELLO_Gen.
+
+\ref build_proc_files "<< Previous"<br>\ref src_dir ">> Next"
+
+\page src_dir The src directory
+
+The \c src directory contains all source files required to build CORBA engine and
+(optionally) GUI libraries of the module. Each of these entities usually
+has (but this is not actually obligatory) its own directory.
+
+The \c Makefile.am simply triggers the path of sub-directories described
+by the \a SUBDIRS target.
+
+- \c src/HELLO sub-directory
+
+This sub-directory contains the C++ source files that implement the engine
+library of the module. The \c Makefile.am defines the rules used to build
+the engine library from these source files. The name of the module
+engine library is predefined and should be set as \c lib\<MODULE\>Engine.so
+where \c MODULE is a name of the module. In the case of the HELLO
+module, the name of the engine library should be \c libHELLOEngine.so.
+
+The \c HELLO.h, \c HELLO.cxx files implement \a HELLO class that is derived
+from the \a HELLO_Gen interface of the \a POA_HELLO_ORB CORBA module and the
+\a SALOME_Component_i class (base implementation of SALOME module engine
+exported by the KERNEL module).
+
+In particular, \a HELLO class implements \a hello() and \a goodbye() functions
+that are defined in the IDL interface \a HELLO_ORB::HELLO_Gen.
+
+\code
+HELLO_ORB::status HELLO::hello( SALOMEDS::Study_ptr study, const char* name )
+{
+...
+}
+HELLO_ORB::status HELLO::goodbye( SALOMEDS::Study_ptr study, const char* name )
+{
+...
+}
+\endcode
+
+In addition, \c HELLO.cxx implements a factory function which is used by
+the SALOME container to create an instance of the HELLO CORBA engine
+by demand:
+
+\code
+extern "C"
+{
+ PortableServer::ObjectId* HELLOEngine_factory(
+ CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName)
+ {
+ HELLO* myHELLO = new HELLO(orb, poa, contId, instanceName, interfaceName);
+ return myHELLO->getId();
+ }
+}
+\endcode
+
+- \c src/HELLOGUI sub-directory
+
+This directory contains the C++ source files that implement the GUI
+library of HELLO module. By default, the name of the module
+GUI library is predefined and should be set as \c lib\<MODULE\>.so
+where \c MODULE is a name of the module. In the case of the HELLO
+module, the name of the GUI library should be \c libHELLO.so. It is
+also possible to use custom name of the GUI library of a module, but
+in this case, in order to be possible to use this module in SALOME GUI
+desktop, the name of the GUI library should be defined in the
+\c SalomeApp.xml file, in the module's main section, using \a "library"
+parameter, for example:
+
+\code
+ <section name="HELLO">
+ <parameter name="name" value="Hello"/>
+ <parameter name="icon" value="HELLO.png"/>
+ <parameter name="library" value="libMyHelloGUIlibrary.so"/>
+ </section>
+\endcode
+
+The implementation of GUI library of the HELLO module should be done
+according to the architecture and rules specified by the SALOME GUI
+module. The main GUI module class (a\ HELLOGUI in our case) should be
+derived from the \a SalomeApp_Module class.
+
+The developer has to redefine a set of methods which define the
+module behavior in GUI, for example, create menus, toolbars, define
+context popup menus, objects selection behavior, implement dialog
+boxes etc.
+
+Here below is a short description of these methods. For more details
+please refer to the SALOME GUI module documentation.
+
+- \a initialize() - module initialization; usually used to create
+ GUI actions, menus, toolbars and so on;
+- \a activateModule() - module activation; perform actions which should
+ be done when the module is activated by the user, for example, show
+ related menus and toolbars;
+- \a deactivateModule() - module deactivation; perform actions which should
+ be done when the module is deactivated by the user, for example,
+ hide related menus and toolbars;
+- \a windows() - get a list and a position of the dockable windows to be
+ associated with the module; these windows will be automatically
+ opened and positioned according to the settings defined by the value
+ returned by this function;
+- \a viewManagers() - get a list of the compatible viewers; these viewers
+ will be automatically opened/raised on the module activation;
+- \a contextMenuPopup() - create and return context popup menu according
+ to the current selection;
+- \a createPreferences() - initialize module's preferences;
+- \a preferencesChanged() - callback function that is called when some
+ module's preference is changed by the user; allows to perform the
+ corresponding actions;
+- \a createSelection() - create and return menu selection object; this is
+ a part of the context popup menu definition API;
+- \a engineIOR() - get the reference to the module CORBA engine;
+- \a moduleIcon() and \a iconName() - these methods can be used to customize
+ the module's main icon;
+- \a displayer() - get the reference to the module's \a Displayer class; this
+ is the part of common Show/Hide functionality mechanism;
+- \a storeVisualParameters() and \a restoreVisualParameters() - these methods
+ can be redefined to store/restore different visualization attributes of the
+ presentable data if it is supported by the module, for example transparency,
+ colors, display mode and other presentable parameters;
+- \a canCopy(), \a copy(), \a canPaste(), \a paste() - these methods are the
+ part of the common Copy/Paste functionality;
+- \a isDraggable(), \a isDropAccepted(), \a dropObjects() - these methods
+ are the part of the common Drag-n-Drop functionality;
+- \a createOperation() - this function can be used as a part of the
+ transaction-based operations mechanism.
+- \a renameAllowed(), \a renameObject() - can be used for in-place (Object
+ browser) renaming of the data entities, if it is supported by the module.
+
+Note, that all of these methods are optional and need not be
+obligatory implemented because \a SalomeApp_Module class provides a
+base implementation of these functions. It's sometimes enough to
+implement only some of them, depending on the module needs.
+
+In the case of HELLO module, only the following methods are
+implemented (other ones are just stubs, added for sample reasons):
+
+- \a engineIOR() that initializes HELLO module's engine:
+
+\code
+QString HELLOGUI::engineIOR() const
+{
+ init(); // initialize engine, if necessary
+ CORBA::String_var anIOR = getApp()->orb()->object_to_string( myEngine.in() );
+ return QString( anIOR.in() );
+}
+\endcode
+
+- \a initialize() that creates actions, menus and toolbars for module's services
+ service:
+
+\code
+void HELLOGUI::initialize( CAM_Application* app )
+{
+ // call the parent implementation
+ SalomeApp_Module::initialize( app );
+
+ // get reference to the desktop (used as a parent for actions)
+ QWidget* dsk = app->desktop();
+ // get resources manager
+ SUIT_ResourceMgr* resMgr = app->resourceMgr();
+
+ // create actions
+ // ... Test me operation
+ createAction( OpTestMe, // operation id
+ tr( "TLT_OP_TESTME" ), // tooltip
+ resMgr->loadPixmap( "HELLO",tr( "ICON_OP_TESTME" ) ), // icon
+ tr( "MEN_OP_TESTME" ), // menu title
+ tr( "STS_OP_TESTME" ), // status tip
+ 0, // accelerator (not set)
+ dsk, // parent
+ false, // togglable flag (no)
+ this, // action receiver
+ SLOT( testMe() ) ); // action slot
+ // create other actions ............
+
+ // create menus
+ int menuId;
+ menuId = createMenu( tr( "MEN_FILE" ), -1, -1 ); // File menu
+ createMenu( separator(), menuId, -1, 10 ); // add separator to File menu
+ menuId = createMenu( tr( "MEN_FILE_HELLO" ), menuId, -1, 10 ); // File - Hello submenu
+ createMenu( OpTestMe, menuId ); // File - Hello - Test me
+ // create other menus ............
+
+ // create toolbars
+ int aToolId;
+ aToolId = createTool ( tr( "TOOL_TEST" ) ); // Test toolbar
+ createTool( OpTestMe, aToolId ); // Test - Test me
+ // create other toolbars ............
+
+ // set-up popup menu
+ QtxPopupMgr* mgr = popupMgr();
+ mgr->insert( action( OpHello ), -1, -1 ); // Hello
+ mgr->setRule( action( OpHello ), baseRule + " and isComponent", QtxPopupMgr::VisibleRule );
+ // create other popup menu commands ............
+}
+\endcode
+
+- \a activateModule() that activates menus and toolbars
+
+\code
+bool HELLOGUI::activateModule( SUIT_Study* theStudy )
+{
+ // call parent implementation
+ bool bOk = SalomeApp_Module::activateModule( theStudy );
+
+ // show own menus
+ setMenuShown( true );
+ // show own toolbars
+ setToolShown( true );
+
+ // return the activation status
+ return bOk;
+}
+\endcode
+
+- \a deactivateModule() that deactivates menus and toolbars
+
+\code
+bool HELLOGUI::deactivateModule( SUIT_Study* theStudy )
+{
+ // hide own menus
+ setMenuShown( false );
+ // hide own toolbars
+ setToolShown( false );
+
+ // call parent implementation and return the activation status
+ return SalomeApp_Module::deactivateModule( theStudy );
+}
+\endcode
+
+- \a windows() that set-ups dockable windows requested by the module
+
+\code
+void HELLOGUI::windows( QMap<int, int>& theMap ) const
+{
+ // want Object browser, in the left area
+ theMap.insert( SalomeApp_Application::WT_ObjectBrowser,
+ Qt::LeftDockWidgetArea );
+ // want Python console, in the bottom area
+ theMap.insert( SalomeApp_Application::WT_PyConsole,
+ Qt::BottomDockWidgetArea );
+}
+\endcode
+
+- \a isDragable(), \a isDropAccepted() and \a dropObjects() methods that handle
+the Drag-n-Drop operation
+
+\code
+bool HELLOGUI::isDragable( const SUIT_DataObject* what ) const
+{
+ // we allow dragging any HELLO object, except the top-level component
+ const SalomeApp_ModuleObject* aModObj = dynamic_cast<const SalomeApp_ModuleObject*>( what );
+ return ( aModObj == 0 );
+}
+
+bool HELLOGUI::isDropAccepted( const SUIT_DataObject* where ) const
+{
+ // we allow dropping of all objects
+ return true;
+}
+
+void HELLOGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* where,
+ const int row, Qt::DropAction action )
+{
+ if (action != Qt::CopyAction && action != Qt::MoveAction)
+ return; // unsupported action
+
+ // get parent object
+ SalomeApp_DataObject* dataObj = dynamic_cast<SalomeApp_DataObject*>( where );
+ if ( !dataObj ) return; // wrong parent
+ _PTR(SObject) parentObj = dataObj->object();
+
+ // collect objects being dropped
+ HELLO_ORB::object_list_var objects = new HELLO_ORB::object_list();
+ objects->length( what.count() );
+ int count = 0;
+ for ( int i = 0; i < what.count(); i++ ) {
+ dataObj = dynamic_cast<SalomeApp_DataObject*>( what[i] );
+ if ( !dataObj ) continue; // skip wrong objects
+ _PTR(SObject) sobj = dataObj->object();
+ objects[i] = _CAST(SObject, sobj)->GetSObject();
+ count++;
+ }
+ objects->length( count );
+
+ // call engine function
+ engine()->copyOrMove( objects.in(), // what
+ _CAST(SObject, parentObj)->GetSObject(), // where
+ row, // row
+ action == Qt::CopyAction ); // isCopy
+
+ // update Object browser
+ getApp()->updateObjectBrowser( false );
+}
+\endcode
+
+An implemention of the \a hello() and \a goodbye() methods is quite simple.
+These operations show the dialog box proposing the user to enter the name and
+pass the name entered by the user to the engine side, using the corresponding
+CORBA service.
+
+\code
+void HELLOGUI::hello()
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ _PTR(Study) studyDS = study->studyDS();
+
+ // request user name
+ bool ok;
+ QString name = QInputDialog::getText( getApp()->desktop(), tr( "QUE_HELLO_TITLE" ), tr( "QUE_ENTER_NAME" ),
+ QLineEdit::Normal, QString::null, &ok );
+
+ if ( ok && !name.trimmed().isEmpty() ) {
+ // say hello to SALOME
+ HELLO_ORB::status status = engine()->hello( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+
+ // update Object browser
+ getApp()->updateObjectBrowser(true);
+
+ // process operation status
+ switch( status ) {
+ case HELLO_ORB::OP_OK:
+ // everything's OK
+ SUIT_MessageBox::information( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "INF_HELLO_MSG" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_ALREADY_MET:
+ // error: already said hello
+ SUIT_MessageBox::warning( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "ERR_HELLO_ALREADY_MET" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_UNKNOWN:
+ default:
+ // other errors
+ SUIT_MessageBox::critical( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "ERR_ERROR" ),
+ tr( "BUT_OK" ) );
+ break;
+ }
+ }
+}
+
+void HELLOGUI::goodbye()
+{
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ _PTR(Study) studyDS = study->studyDS();
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+
+ QString name;
+
+ // get selection
+ SALOME_ListIO selected;
+ aSelMgr->selectedObjects( selected );
+ if ( selected.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) io = selected.First();
+ _PTR(SObject) so = studyDS->FindObjectID( io->getEntry() );
+ if ( so ) {
+ _PTR(SComponent) comp = so->GetFatherComponent();
+ if ( comp && comp->ComponentDataType() == "HELLO" && io->getEntry() != comp->GetID() ) {
+ name = so->GetName().c_str();
+ }
+ }
+ }
+
+ // request user name if not specified
+ if ( name.isEmpty() ) {
+ bool ok;
+ name = QInputDialog::getText( getApp()->desktop(), tr( "QUE_GOODBYE_TITLE" ), tr( "QUE_ENTER_NAME" ),
+ QLineEdit::Normal, QString::null, &ok );
+ }
+
+ if ( !name.trimmed().isEmpty() ) {
+ // say goodby to SALOME
+ HELLO_ORB::status status = engine()->goodbye( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+
+ // update Object browser
+ getApp()->updateObjectBrowser(true);
+
+ // process operation status
+ switch( status ) {
+ case HELLO_ORB::OP_OK:
+ // everything's OK
+ SUIT_MessageBox::information( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "INF_GOODBYE_MSG" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_DID_NOT_MEET:
+ // error: did not say hello yet
+ SUIT_MessageBox::warning( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "ERR_GOODBYE_DID_NOT_MEET" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_UNKNOWN:
+ default:
+ // other errors
+ SUIT_MessageBox::critical( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "ERR_ERROR" ),
+ tr( "BUT_OK" ) );
+ break;
+ }
+ }
+}
+\endcode
+
+Also, \c HELLOGUI.cxx provide an implementation of a factory function that is used
+by the SALOME GUI to create an instance of the HELLO GUI class by demand.
+It implements also another factory function to retrieve the
+version number of the module (in the About dialog box for example):
+
+\code
+extern "C" {
+ CAM_Module* createModule()
+ {
+ return new HELLOGUI();
+ }
+
+ char* getModuleVersion()
+ {
+ return (char*)HELLO_VERSION_STR;
+ }
+}
+\endcode
+
+\ref idl_dir "<< Previous"<br>\ref bin_dir ">> Next"
+
+\page bin_dir The bin directory
+
+The file \c VERSION.in is used to document the module, it must define its
+version and (optionally) its compatibilities or incompatibilities with
+other modules. Therefore, it is strongly recommended but is not
+essential for correct operation of the module.
+
+The \c runAppli.in file is the equivalent of the \c runSalome script
+distributed by the KERNEL module but configured to start SALOME
+session with HELLO module only.
+
+The \c myrunSalome.py file reuses part of functionality provided by the
+KERNEL's \c runSalome.py script. It is used to run SALOME session and
+start HELLO module in this session.
+
+\ref src_dir "<< Previous"<br>\ref doc_dir ">> Next"
+
+\page doc_dir The doc directory
+
+This directory provides documentation files of the module. The
+documentation of the module can be implemented in the arbitrary
+way. But if you want your documentation to appear in the SALOME GUI
+desktop's Help menu, some specific actions should be done as follows.
+
+The documentation should be generated in the HTML format. For example,
+the documentation of the HELLO module is generated using Doxygen
+tool. It allows to generate structured set of HTML pages from the set
+of input plain text files. Input source files should include Doxygen
+tags and optionally direct HTML tags. For more details please refer to
+the Doxygen documentation.
+
+The resulting documentation of a module should include at least one
+file \c index.html. All the HTML and image files should be exported by
+the build procedure to the following directory:
+\c \<module_installation_dir\>/share/doc/salome/gui/\<MODULE\>
+where \c module_installation_dir is a module installation folder and
+\c MODULE is its name. For example, for HELLO module, at least one file
+should exist:
+\c \<HELLO_module_installation_dir\>/share/doc/salome/gui/HELLO/index.html.
+
+The SALOME GUI automatically searches for the index.html file in the
+mentioned module directory. If the file is found, the corresponding
+menu command is automatically added to the Help menu of the SALOME GUI
+desktop.
+
+\ref bin_dir "<< Previous"<br>\ref build_procedure ">> Next"
+
+\page build_procedure Construction, installation
+
+Before building HELLO module, please ensure that SALOME environment is
+set properly. Assume that SALOME environment is set in env_products.sh
+script. In order to build and install HELLO module, you have to
+perform several steps:
+
+<pre>
+[bash% ] source env_products.sh
+[bash% ] mkdir HELLO_BUILD
+[bash% ] cd HELLO_BUILD
+[bash% ] ../HELLO1_SRC/build_configure
+[bash% ] ../HELLO1_SRC/configure --prefix=\<HELLO_module_installation_dir\>
+[bash% ] make
+[bash% ] make install
+</pre>
+
+The first command creates a build directory for the HELLO module. Then
+next step is to cd to this build directory. From this directory you
+sequentially invoke \c build_configure, \c configure, \c make and \c make install
+commands. On each step, you have to ensure that the operation is
+finished correctly (no errors raised).
+
+The \c \<HELLO_module_installation_dir\> variable above defines the
+destination directory to which the HELLO module should be
+installed. After the last step is finished, the HELLO module is built
+and installed to the \c \<HELLO_module_installation_dir\> directory.
+
+\ref doc_dir "<< Previous"<br>\ref run_procedure ">> Next"
+
+\page run_procedure Running SALOME
+
+Go to the the \c \<HELLO_module_installation_dir\> directory and type:
+
+<pre>
+[bash% ] ./bin/salome/runAppli
+</pre>
+
+This command runs SALOME session configured for KERNEL and the HELLO
+module. At the end of running, the user will be prompted by the
+Python interpreter command line configured for SALOME that provides
+access to SALOME Python API (including CORBA interfaces).
+
+The \c runAppli file is a shell script that executes a Python commands
+running SALOME session by passing arguments to it in a command line:
+
+<pre>
+${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i $HELLO_ROOT_DIR/bin/salome/myrunSalome.py --modules=HELLO --killall
+</pre>
+
+These arguments state that the \c myrunSalome.py script located in the
+HELLO module will be used, that the HELLO component will be
+activated and all previously running SALOME sessions should be
+shutdowned.
+
+This command will not function unless the following environment
+variables have previously been set:
+
+<pre>
+export KERNEL_ROOT_DIR=\<KERNEL_module_installation_dir\>
+export HELLO_ROOT_DIR=\<HELLO_module_installation_dir\>
+</pre>
+
+\warning It is possible that the SALOME run will not reach the end.
+In some circumstances, the time to start CORBA servers may be long and
+could exceed the timeout. If the reasons is that the time to
+load dynamic libraries is long, it is possible that a second run
+immediately afterwards will be successful.
+
+\ref build_procedure "<< Previous"<br>\ref load_module ">> Next"
+
+\page load_module Loading HELLO component
+
+The \a HELLO_ORB module has to be imported before making a request to
+load the component into the container, to obtain access to methods of
+the component. This container is made accessible in the \c myrunSalome.py
+by means of the \a container variable:
+
+<pre>
+>> import salome
+>> salome.salome_init()
+>> import HELLO_ORB
+>> c = container.load_impl("HELLO", "HELLO")
+>> c.hello(salome.myStudy, "Christian")
+</pre>
+
+The last instruction invokes HELLO module's service \a hello(). Proceed as
+follows to see the CORBA objects created by these actions:
+
+<pre>
+>> clt.showNS()
+</pre>
+
+\ref run_procedure "<< Previous"<br>\ref catalog_def ">> Next"
+
+\page catalog_def HELLO module catalog definition
+
+In the example from the previous chapter, the HELLO component was
+loaded by making a direct request to the SALOME container. This is not
+the standard method for loading of a component. The normal way uses
+the SALOME LifeCycle service that invokes SALOME Module Catalog
+services to identify the component and its properties and then calls
+the requested container to load the component.
+
+Before this method can be used, the component must be declared in a
+catalog in the XML format, for which the name must be
+\c \<MODULE\>Catalog.xml. In our case, it will be \c HELLOCatalog.xml.
+Usually this catalog is put to the resources sub-directory of the
+directory tree. The simplest way to create this file is to use Catalog
+Generator utility provided by the SALOME KERNEL module, that can
+automatically generate XML description file from the IDL file.
+
+\ref load_module "<< Previous"<br>\ref load_lcc ">> Next"
+
+\page load_lcc Loading HELLO component via LifeCycle service
+
+The method of loading the component is not very different from that
+is described above. The services of the LifeCycle module are used in
+this case instead of calling the container directly. The call sequence
+is contained in the \c myrunSalome.py \a test() function.
+
+<pre>
+ import salome
+ salome.salome_init()
+ c = test(clt)
+ c.hello(salome.myStudy, "Christian")
+</pre>
+
+The test function creates the LifeCycle object. It then asks for the
+HELLO component to be loaded in the \a FactoryServer container:
+
+\code
+def test(clt):
+ """
+ Test function that creates an instance of HELLO component
+ usage : hello=test(clt)
+ """
+ import LifeCycleCORBA
+ lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
+ import HELLO_ORB
+ hello = lcc.FindOrLoadComponent("FactoryServer", "HELLO")
+ return hello
+\endcode
+
+\ref catalog_def "<< Previous"<br>\ref load_iapp ">> Next"
+
+\page load_iapp Loading from the GUI (IAPP)
+
+In order to activate HELLO module in the SALOME GUI desktop, the user
+should press the HELLO module's button on the \a Modules toolbar or
+select the name of the module in the combo box on this toolbar.
+
+The image file to be used as an icon of a module should be exported by
+the module build procedure. The icon file name is defined in \c SalomeApp.xml:
+\code
+ <section name="HELLO">
+ <parameter name="name" value="Hello"/>
+ <parameter name="icon" value="HELLO.png"/>
+ </section>
+\endcode
+
+\ref load_lcc "<< Previous"
+
+*/
--- /dev/null
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+ color: #4665A2;
+}
+
+a.codeRef {
+ color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+ margin-left: -1cm;
+}
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
+}
+
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ box-shadow: 2px 2px 3px #999;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
+}
+
+div.version {
+ border:1px solid #0000FF;
+ color: #CCCCCC;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ text-align: center;
+ width:100px;
+ -moz-border-radius: 8px;
+ margin: 5px;
+}
+
+div.footer1 {
+ background-color: #DFE5F1;
+ border: 1px solid #AAAAAA;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ padding: 10px;
+ margin-top: 15px;
+}
+
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+ font-size: 75%;
+}
+
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
+}
+
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+ height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* opera specific markup */
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* opera specific markup */
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+ border-spacing: 6px 2px;
+}
+
+.params .paramname, .retval .paramname {
+ font-weight: bold;
+ vertical-align: top;
+}
+
+.params .paramtype {
+ font-style: italic;
+ vertical-align: top;
+}
+
+.params .paramdir {
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
+}
+
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
+*/
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+}
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+ color:#6884BD;
+}
+
+.navpath li.footer
+{
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
+
+div.ingroups
+{
+ font-size: 8pt;
+ padding-left: 5px;
+ width: 50%;
+ text-align: left;
+}
+
+div.ingroups a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 10px;
+}
+
+.title {
+ font-size: 150%;
+ font-weight: bold;
+ margin: 10px 2px;
+}
+
+dl
+{
+ padding: 0 0 0 10px;
+}
+
+dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
+{
+ border-left:4px solid;
+ padding: 0 0 0 6px;
+}
+
+dl.note
+{
+ border-color: #D0D000;
+}
+
+dl.warning, dl.attention
+{
+ border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+ border-color: #00D000;
+}
+
+dl.deprecated
+{
+ border-color: #505050;
+}
+
+dl.todo
+{
+ border-color: #00C0E0;
+}
+
+dl.test
+{
+ border-color: #3030E0;
+}
+
+dl.bug
+{
+ border-color: #C08050;
+}
+
+#projectlogo
+{
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
+}
+
+#projectlogo img
+{
+ border: 0px none;
+}
+
+#projectname
+{
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+/* font: 300% arial,sans-serif;*/
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectbrief
+{
+ font: 120% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectnumber
+{
+ font: 50% arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+
+#titlearea
+{
+ background: url("head.png");
+ background-color: #175783;
+ border: 1px solid;
+ height: 80px;
+ background-repeat: no-repeat;
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
+}
+
--- /dev/null
+ <li class="footer"></li>
+ </ul>
+ </div>
+ <div class="footer1">
+ <div style="text-align: center;">
+ Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br>
+ Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS<br>
+ </div>
+ </div>
+</body>
+</html>
+
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<title>$title</title>
+<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
+$treeview
+$search
+$mathjax
+<script type="text/javascript">
+$(document).ready(initResizable);
+</script>
+<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body onload='searchBox.OnSelectItem(0);'>
+<div id="top"><!-- do not remove this div! -->
+<div id="titlearea"><div align="right"><div class="version">Version: @VERSION@</div></div></div>
+
+</div>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __HELLO_GEN__
#define __HELLO_GEN__
+
/*!
- \defgroup EXAMPLES SALOME EXAMPLES components
- */
+ \defgroup EXAMPLES SALOME EXAMPLES components
+*/
#include "SALOME_Component.idl"
#include "SALOME_Exception.idl"
-
-/*! \ingroup EXAMPLES
-
-This package contains the interface HELLO_ORB used
-for %HELLO component as an example in %SALOME application.
+/*!
+ \ingroup EXAMPLES
+ This package contains the interface HELLO_ORB used
+ for %HELLO component as an example in %SALOME application.
*/
module HELLO_ORB
{
- /*! \brief Interface of the %HELLO component
+ typedef sequence<SALOMEDS::SObject> object_list;
+
+ /*!
+ \brief Operation result codes
+ */
+ enum status {
+ OP_OK, //!< OK result
+ OP_ERR_ALREADY_MET, //!< ERROR: already met
+ OP_ERR_DID_NOT_MEET, //!< ERROR: did not meet yet
+ OP_ERR_UNKNOWN //!< ERROR: other problems
+ };
+
+ /*!
+ \brief Interface of the %HELLO component
*/
- interface HELLO_Gen : Engines::Component
+ interface HELLO_Gen : Engines::EngineComponent
{
- /*!
- Set the Name and return the string concatenation of "hello, " and the given name.
- */
- string makeBanner(in string name)
- raises (SALOME::SALOME_Exception);
+ /*!
+ \brief Say hello to \a name
+ \param study SALOME study
+ \param name person's name
+ \return operation status
+ */
+ status hello( in SALOMEDS::Study study, in string name )
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ \brief Say goodbye to \a name
+ \param study SALOME study
+ \param name person's name
+ \return operation status
+ */
+ status goodbye( in SALOMEDS::Study study, in string name )
+ raises (SALOME::SALOME_Exception);
+
+ /*!
+ \brief Copy or move objects to the specified position
+
+ This function is used in the drag-n-drop functionality.
+
+ \param what objects being copied/moved
+ \param where parent object where objects are copied/moved to
+ \param row position in the parent object's children list at which objects are copied/moved
+ \param isCopy \c true if object are copied or \c false otherwise
+ */
+ void copyOrMove( in object_list what, in SALOMEDS::SObject where, in long row, in boolean isCopy );
};
};
#endif
-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
BASEIDL_FILES = HELLO_Gen.idl
+BASEIDL_FILES_PY=$(BASEIDL_FILES:%.idl=%_idl.py)
+
# This variable defines the files to be installed
dist_salomeidl_DATA = $(BASEIDL_FILES)
libSalomeIDLHELLO_la_CPPFLAGS = \
$(KERNEL_CXXFLAGS) \
- -I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ \
@CORBA_INCLUDES@
-bcxx \
@IDLCXXFLAGS@ \
-I$(top_builddir)/idl/salome \
- -I$(KERNEL_ROOT_DIR)/idl/salome \
- -I$(top_builddir)/salome_adm/unix
+ -I$(KERNEL_ROOT_DIR)/idl/salome
IDLPYFLAGS = \
@IDLPYFLAGS@ \
-I$(KERNEL_ROOT_DIR)/idl/salome
$(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
-# uninstall-local removes too much, but it works in distcheck
+# we want to remove only staff generated for IDL files and nothing more
uninstall-local:
- rm -rf $(DESTDIR)$(salomepythondir)/*
+ @for modulen in HELLO_ORB ; do \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen} && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen} ; \
+ test -d $(DESTDIR)$(salomepythondir)/$${modulen}__POA && echo "Removing $(DESTDIR)$(salomepythondir)/$${modulen}__POA" && rm -rf $(DESTDIR)$(salomepythondir)/$${modulen}__POA ; \
+ done ; \
+ for filen in $(BASEIDL_FILES_PY) ; do \
+ echo "Removing $(DESTDIR)$(salomepythondir)/$${filen}" && rm -f $(DESTDIR)$(salomepythondir)/$${filen}* ; \
+ done
mostlyclean-local:
-rm -f *.hh *.cc .depidl
<?xml version='1.0' encoding='us-ascii' ?>
<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-->
-
+
<!-- XML component catalog -->
<begin-catalog>
-
-<!-- Path prefix information -->
-
-<path-prefix-list>
-</path-prefix-list>
-
-<!-- Component list -->
-<component-list>
+ <!-- Path prefix information -->
+ <path-prefix-list></path-prefix-list>
+ <!-- Type information -->
+ <type-list>
+ <type name="status" kind="int"/>
+ </type-list>
+ <!-- Component list -->
+ <component-list>
+ <!-- Component -->
<component>
- <!-- Component identification -->
- <component-name>HELLO</component-name>
- <component-username>HELLO GUI</component-username>
- <component-type>Data</component-type>
- <component-author>C. Caremoli</component-author>
- <component-version>@VERSION@</component-version>
- <component-comment>EDF - RD</component-comment>
- <component-multistudy>1</component-multistudy>
- <component-icone>HELLO.png</component-icone>
- <constraint>'linux' ~ OS</constraint>
-
- </component>
-</component-list>
+ <!-- Component identification -->
+ <component-name>HELLO</component-name>
+ <component-username>Hello</component-username>
+ <component-type>OTHER</component-type>
+ <component-author>Vadim SANDLER</component-author>
+ <component-version>@VERSION@</component-version>
+ <component-comment>Sample module</component-comment>
+ <component-multistudy>1</component-multistudy>
+ <component-impltype>1</component-impltype>
+ <component-icone>HELLO.png</component-icone>
+ <constraint></constraint>
+ <!-- Component interface -->
+ <component-interface-list>
+ <component-interface-name>HELLO_Gen</component-interface-name>
+ <component-interface-comment>Hello engine</component-interface-comment>
+ <component-service-list>
+ <component-service>
+ <service-name>hello</service-name>
+ <service-author>Vadim SANDLER</service-author>
+ <service-version>@VERSION@</service-version>
+ <service-comment>Hello function</service-comment>
+ <service-by-default>1</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>study</inParameter-name>
+ <inParameter-type>Study</inParameter-type>
+ <inParameter-comment>study</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>name</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>user name</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>status</outParameter-type>
+ <outParameter-comment>operation status</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ <component-service>
+ <service-name>goodbye</service-name>
+ <service-author>Vadim SANDLER</service-author>
+ <service-version>@VERSION@</service-version>
+ <service-comment>Goodbye function</service-comment>
+ <service-by-default>0</service-by-default>
+ <inParameter-list>
+ <inParameter>
+ <inParameter-name>study</inParameter-name>
+ <inParameter-type>Study</inParameter-type>
+ <inParameter-comment>study</inParameter-comment>
+ </inParameter>
+ <inParameter>
+ <inParameter-name>name</inParameter-name>
+ <inParameter-type>string</inParameter-type>
+ <inParameter-comment>user name</inParameter-comment>
+ </inParameter>
+ </inParameter-list>
+ <outParameter-list>
+ <outParameter>
+ <outParameter-name>return</outParameter-name>
+ <outParameter-type>status</outParameter-type>
+ <outParameter-comment>operation status</outParameter-comment>
+ </outParameter>
+ </outParameter-list>
+ <DataStream-list></DataStream-list>
+ </component-service>
+ </component-service-list>
+ </component-interface-list>
+ </component>
+ </component-list>
</begin-catalog>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_salomeres_DATA = \
-SalomeApp.xml \
HELLO.png \
-ExecHELLO.png
+handshake.png \
+goodbye.png \
+testme.png
# VSR: little trick to avoid putting if HELLOCatalog.xml to the distribution archive
-nodist_salomeres_SCRIPTS = HELLOCatalog.xml
+nodist_salomeres_SCRIPTS = HELLOCatalog.xml SalomeApp.xml
+++ /dev/null
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
-<document>
- <section name="HELLO">
- <!-- Major module parameters -->
- <parameter name="name" value="Hello"/>
- <parameter name="icon" value="HELLO.png"/>
- </section>
- <section name="resources">
- <!-- Module resources -->
- <parameter name="HELLO" value="${HELLO_ROOT_DIR}/share/salome/resources/hello"/>
- </section>
-</document>
--- /dev/null
+<!--
+ Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+
+ Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+ CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+
+ 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
+
+-->
+<document>
+ <section name="HELLO">
+ <!-- Major module parameters -->
+ <parameter name="name" value="Hello"/>
+ <parameter name="icon" value="HELLO.png"/>
+ <parameter name="version" value="@VERSION@"/>
+ <parameter name="documentation" value="hello_help"/>
+ </section>
+ <section name="resources">
+ <!-- Module resources -->
+ <parameter name="HELLO" value="%HELLO_ROOT_DIR%/share/salome/resources/hello"/>
+ </section>
+ <section name="hello_help" >
+ <parameter name="sub_menu" value="Samples"/>
+ <parameter name="%1 User's Guide" value="%HELLO_ROOT_DIR%/share/doc/salome/gui/HELLO/index.html"/>
+ </section>
+</document>
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-using namespace std;
+
#include "HELLO.hxx"
-#include "utilities.h"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+
+#include <Utils_ExceptHandlers.hxx>
#include <string>
+namespace {
+ static std::string studyName( const std::string& name )
+ {
+ std::string fullName = "/Hello/";
+ fullName += name;
+ return fullName;
+ }
+}
-//=============================================================================
/*!
- * standard constructor
- */
-//=============================================================================
-
-HELLO::HELLO(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName) :
- Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
+ \brief Constructor
+
+ Creates an instance of the HELLO component engine
+
+ \param orb reference to the ORB
+ \param poa reference to the POA
+ \param contId CORBA object ID, pointing to the owner SALOME container
+ \param instanceName SALOME component instance name
+ \param interfaceName SALOME component interface name
+*/
+HELLO::HELLO( CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName )
+ : Engines_Component_i( orb, poa, contId, instanceName, interfaceName )
{
- MESSAGE("activate object");
- _thisObj = this ;
- _id = _poa->activate_object(_thisObj);
+ _thisObj = this;
+ _id = _poa->activate_object( _thisObj ); // register and activate this servant object
}
+/*!
+ \brief Destructor
+
+ Clean up allocated resources
+*/
HELLO::~HELLO()
{
+ // nothing to do
}
+/*!
+ \brief Say hello to \a name
+ \param study SALOME study
+ \param name person's name
+ \return operation status
+*/
+HELLO_ORB::status HELLO::hello( SALOMEDS::Study_ptr study, const char* name )
+{
+ // set exception handler to catch unexpected CORBA exceptions
+ Unexpect aCatch(SALOME_SalomeException);
+
+ // set result status to error initially
+ HELLO_ORB::status result = HELLO_ORB::OP_ERR_UNKNOWN;
+
+ // check if reference to study is valid
+ if ( !CORBA::is_nil( study ) ) {
+ // get full object path
+ std::string fullName = studyName( name );
+ // check if the object with the same name is already registered in the study
+ SALOMEDS::SObject_var sobj = study->FindObjectByPath( fullName.c_str() );
+ if ( !CORBA::is_nil( sobj ) ) {
+ // person is already registered in the study -> ERROR
+ result = HELLO_ORB::OP_ERR_ALREADY_MET;
+ }
+ else {
+ // person is not registered yet -> register
+ SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); // study builder
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder(); // use case builder
+
+ // find HELLO component; create it if not found
+ SALOMEDS::SComponent_var father = study->FindComponent( "HELLO" );
+ if ( CORBA::is_nil( father ) ) {
+ // create component
+ father = studyBuilder->NewComponent( "HELLO" );
+ // set name attribute
+ father->SetAttrString( "AttributeName", "Hello" );
+ // set icon attribute
+ father->SetAttrString( "AttributePixMap", "ICON_HELLO" );
+ // register component in the study
+ studyBuilder->DefineComponentInstance( father, HELLO_Gen::_this() );
+ // add component to the use case tree
+ // (to support tree representation customization and drag-n-drop)
+ useCaseBuilder->SetRootCurrent();
+ useCaseBuilder->Append( father ); // component object is added as the top level item
+ }
+
+ // create new sub-object, as a child of the component object
+ sobj = studyBuilder->NewObject( father );
+ sobj->SetAttrString( "AttributeName", name );
+ // add object to the use case tree
+ // (to support tree representation customization and drag-n-drop)
+ useCaseBuilder->AppendTo( father, sobj );
-char* HELLO::makeBanner(const char* name)
+ // cleanup
+ father->UnRegister();
+ sobj->UnRegister();
+
+ // set operation status
+ result = HELLO_ORB::OP_OK;
+ }
+ }
+
+ // return result of the operation
+ return result;
+}
+
+/*!
+ \brief Say goodbye to \a name
+ \param study SALOME study
+ \param name person's name
+ \return operation status
+*/
+HELLO_ORB::status HELLO::goodbye( SALOMEDS::Study_ptr study, const char* name )
{
- string banner="Hello, ";
- banner+=name;
- return CORBA::string_dup(banner.c_str());
+ // set exception handler to catch unexpected CORBA exceptions
+ Unexpect aCatch(SALOME_SalomeException);
+
+ // set result status to error initially
+ HELLO_ORB::status result = HELLO_ORB::OP_ERR_UNKNOWN;
+
+ // check if reference to study is valid
+ if ( !CORBA::is_nil( study ) ) {
+ // get full object path
+ std::string fullName = studyName( name );
+
+ // initially set error status: person is not registered
+ result = HELLO_ORB::OP_ERR_DID_NOT_MEET;
+
+ // check if the object with the same name is registered in the study
+ // find all objects with same name
+ SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); // study builder
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder(); // use case builder
+ SALOMEDS::SObject_var sobj = study->FindObjectByPath( fullName.c_str() );
+ while ( !CORBA::is_nil( sobj ) ) {
+ std::list<SALOMEDS::SObject_var> toRemove;
+ toRemove.push_back( sobj );
+ SALOMEDS::UseCaseIterator_var useCaseIt = useCaseBuilder->GetUseCaseIterator( sobj ); // use case iterator
+ for ( useCaseIt->Init( true ); useCaseIt->More(); useCaseIt->Next() )
+ toRemove.push_back( useCaseIt->Value() );
+ // perform removing of all found objects (recursively with children)
+ std::list<SALOMEDS::SObject_var>::const_iterator it;
+ for( it = toRemove.begin(); it != toRemove.end(); ++it ) {
+ sobj = *it;
+ // remove object from the study
+ // - normally it's enough to call RemoveObject() method
+ // RemoveObject`WithChildren() also removes all children recursively if there are any
+ // - it's not necessary to remove it from use case builder, it is done automatically
+ studyBuilder->RemoveObjectWithChildren( sobj );
+
+ // cleanup
+ sobj->UnRegister();
+
+ // set operation status to OK as at least one object is removed
+ result = HELLO_ORB::OP_OK;
+ }
+ sobj = study->FindObjectByPath( fullName.c_str() );
+ }
+ }
+
+ // return result of the operation
+ return result;
}
+/*!
+ \brief Copy or move objects to the specified position
+
+ This function is used in the drag-n-drop functionality.
+
+ \param what objects being copied/moved
+ \param where parent object where objects are copied/moved to
+ \param row position in the parent object's children list at which objects are copied/moved
+ \param isCopy \c true if object are copied or \c false otherwise
+*/
+void HELLO::copyOrMove( const HELLO_ORB::object_list& what,
+ SALOMEDS::SObject_ptr where,
+ CORBA::Long row, CORBA::Boolean isCopy )
+{
+ if ( CORBA::is_nil( where ) ) return; // bad parent
+ SALOMEDS::Study_var study = where->GetStudy(); // study
+ SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); // study builder
+ SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder(); // use case builder
+ SALOMEDS::SComponent_var father = where->GetFatherComponent(); // father component
+ std::string dataType = father->ComponentDataType();
+ if ( dataType != "HELLO" ) return; // not a HELLO component
+
+ SALOMEDS::SObject_var objAfter;
+ if ( row >= 0 && useCaseBuilder->HasChildren( where ) ) {
+ // insert at given row -> find insertion position
+ SALOMEDS::UseCaseIterator_var useCaseIt = useCaseBuilder->GetUseCaseIterator( where );
+ int i;
+ for ( i = 0; i < row && useCaseIt->More(); i++, useCaseIt->Next() );
+ if ( i == row && useCaseIt->More() ) {
+ objAfter = useCaseIt->Value();
+ }
+ }
+
+ for ( int i = 0; i < what.length(); i++ ) {
+ SALOMEDS::SObject_var sobj = what[i];
+ if ( CORBA::is_nil( sobj ) ) continue; // skip bad object
+ if ( isCopy ) {
+ // copying is performed
+ // get name of the object
+ CORBA::String_var name = sobj->GetName();
+ // create new object, as a child of the component object
+ SALOMEDS::SObject_var new_sobj = studyBuilder->NewObject( father );
+ new_sobj->SetAttrString( "AttributeName", name.in() );
+ sobj = new_sobj;
+ }
+ // insert the object or its copy to the use case tree
+ if ( !CORBA::is_nil( objAfter ) )
+ useCaseBuilder->InsertBefore( sobj, objAfter ); // insert at given row
+ else
+ useCaseBuilder->AppendTo( where, sobj ); // append to the end of list
+ }
+}
extern "C"
{
- PortableServer::ObjectId * HELLOEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName)
+ /*!
+ \brief Exportable factory function: create an instance of the HELLO component engine
+ \param orb reference to the ORB
+ \param poa reference to the POA
+ \param contId CORBA object ID, pointing to the owner SALOME container
+ \param instanceName SALOME component instance name
+ \param interfaceName SALOME component interface name
+ \return CORBA object identifier of the registered servant
+ */
+ PortableServer::ObjectId* HELLOEngine_factory( CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName )
{
- MESSAGE("PortableServer::ObjectId * HELLOEngine_factory()");
- SCRUTE(interfaceName);
- HELLO * myHELLO
- = new HELLO(orb, poa, contId, instanceName, interfaceName);
- return myHELLO->getId() ;
+ HELLO* component = new HELLO( orb, poa, contId, instanceName, interfaceName );
+ return component->getId();
}
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef _HELLO_HXX_
#define _HELLO_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(HELLO_Gen)
-#include "SALOME_Component_i.hxx"
+#include <SALOME_Component_i.hxx>
class HELLO:
public POA_HELLO_ORB::HELLO_Gen,
public Engines_Component_i
{
-
public:
- HELLO(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
- virtual ~HELLO();
-
- //
-
- char* makeBanner(const char* name);
-
+ HELLO( CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName );
+ virtual ~HELLO();
+
+ HELLO_ORB::status hello ( SALOMEDS::Study_ptr study, const char* name );
+ HELLO_ORB::status goodbye( SALOMEDS::Study_ptr study, const char* name );
+ void copyOrMove( const HELLO_ORB::object_list& what,
+ SALOMEDS::SObject_ptr where,
+ CORBA::Long row, CORBA::Boolean isCopy );
};
extern "C"
- PortableServer::ObjectId * HELLOEngine_factory(
- CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
-
+PortableServer::ObjectId* HELLOEngine_factory( CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId* contId,
+ const char* instanceName,
+ const char* interfaceName );
#endif
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# SuperVisionTest AddComponent : example of component that adds two numbers
# File : Makefile.in
# Author : , CEA
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
$(KERNEL_CXXFLAGS) \
- -I$(top_builddir)/idl \
- -I$(top_builddir)/salome_adm/unix
+ -I$(top_builddir)/idl
libHELLOEngine_la_LDFLAGS = \
../../idl/libSalomeIDLHELLO.la \
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "HELLOGUI.h"
+#include "HELLO_version.h"
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SalomeApp_DataObject.h>
+
+#include <LightApp_SelectionMgr.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Desktop.h>
-#include <SalomeApp_Application.h>
+
+#include <QtxPopupMgr.h>
+
+#include <SALOME_ListIO.hxx>
#include <SALOME_LifeCycleCORBA.hxx>
+#include <SALOMEDS_SObject.hxx>
+#include <SALOMEDS_Study.hxx>
-// QT Includes
#include <QInputDialog>
-#include <QIcon>
-using namespace std;
+//! The only instance of the reference to engine
+HELLO_ORB::HELLO_Gen_var HELLOGUI::myEngine;
+
+/*!
+ \brief Constructor
+
+ Creates an instance of the HELLO GUI module.
+ Initializes (loads if necessary) HELLO module engine.
-// Constructor
+ \note Since SalomeApp_Module uses virtual inheritance
+ from LightApp_Module class, it's necessary to call both
+ base classes constructors, even though HELLOGUI class
+ inherits directly only SalomeApp_Module.
+*/
HELLOGUI::HELLOGUI() :
- SalomeApp_Module( "HELLO" ) // default name
+ SalomeApp_Module( "HELLO" ), // module name
+ LightApp_Module( "HELLO" ) // module name
{
+ init(); // internal initialization
}
-// Gets an reference to the module's engine
-HELLO_ORB::HELLO_Gen_ptr HELLOGUI::InitHELLOGen( SalomeApp_Application* app )
+/*!
+ \brief Destructor
+
+ Destroys any allocated resources.
+*/
+HELLOGUI::~HELLOGUI()
{
- Engines::Component_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","HELLO" );
- HELLO_ORB::HELLO_Gen_ptr clr = HELLO_ORB::HELLO_Gen::_narrow(comp);
- ASSERT(!CORBA::is_nil(clr));
- return clr;
+ // nothing to do
}
-// Module's initialization
-void HELLOGUI::initialize( CAM_Application* app )
+/*!
+ \brief Get a reference to the HELLO module CORBA engine
+
+ \note This function returns vartype in order to minimize possible crashes
+ when using this function with assignment operations.
+ On the other hand, this simplifies usage of this function when using it outside
+ the assignment operations, to minimize memory leaks caused by orphan CORBA
+ references (no need to take care of reference counting).
+
+ \return reference to the module engine
+*/
+HELLO_ORB::HELLO_Gen_var HELLOGUI::engine()
{
+ init(); // initialize engine, if necessary
+ return myEngine;
+}
- SalomeApp_Module::initialize( app );
+/*!
+ \brief Module initialization.
+
+ Overloaded from CAM_Module class.
+
+ Perform general module initialization (like creation of actions,
+ menus, toolbars, etc).
- InitHELLOGen( dynamic_cast<SalomeApp_Application*>( app ) );
+ \note This function is invoked only once per study, when the module
+ is first time activated by the user.
+ The study associated with the application might not exist
+ (created or opened) when this function is invoked, so it is not
+ recommended to perform any study-dependant actions here.
- QWidget* aParent = application()->desktop();
- SUIT_ResourceMgr* aResourceMgr = app->resourceMgr();
+ \param app pointer to the current application instance
+*/
+void HELLOGUI::initialize( CAM_Application* app )
+{
+ // call the parent implementation
+ SalomeApp_Module::initialize( app );
+
+ // get reference to the desktop (used as a parent for actions)
+ QWidget* dsk = app->desktop();
+ // get resources manager
+ SUIT_ResourceMgr* resMgr = app->resourceMgr();
// create actions
- createAction( 190, tr( "TLT_MY_NEW_ITEM" ), QIcon(), tr( "MEN_MY_NEW_ITEM" ), tr( "STS_MY_NEW_ITEM" ), 0, aParent, false,
- this, SLOT( OnMyNewItem() ) );
- QPixmap aPixmap = aResourceMgr->loadPixmap( "HELLO",tr( "ICON_GET_BANNER" ) );
- createAction( 901, tr( "TLT_GET_BANNER" ), QIcon( aPixmap ), tr( "MEN_GET_BANNER" ), tr( "STS_GET_BANNER" ), 0, aParent, false,
- this, SLOT( OnGetBanner() ) );
+ // ... Test me operation
+ createAction( OpTestMe, // operation id
+ tr( "TLT_OP_TESTME" ), // tooltip
+ resMgr->loadPixmap( "HELLO",tr( "ICON_OP_TESTME" ) ), // icon
+ tr( "MEN_OP_TESTME" ), // menu title
+ tr( "STS_OP_TESTME" ), // status tip
+ 0, // accelerator (not set)
+ dsk, // parent
+ false, // togglable flag (no)
+ this, // action receiver
+ SLOT( testMe() ) ); // action slot
+ // ... Hello operation
+ createAction( OpHello, // operation id
+ tr( "TLT_OP_HELLO" ), // tooltip
+ resMgr->loadPixmap( "HELLO",tr( "ICON_OP_HELLO" ) ), // icon
+ tr( "MEN_OP_HELLO" ), // menu title
+ tr( "STS_OP_HELLO" ), // status tip
+ 0, // accelerator (not set)
+ dsk, // parent
+ false, // togglable flag (no)
+ this, // action receiver
+ SLOT( hello() ) ); // action slot
+ // ... Goodbye operation
+ createAction( OpGoodbye, // operation id
+ tr( "TLT_OP_GOODBYE" ), // tooltip
+ resMgr->loadPixmap( "HELLO",tr( "ICON_OP_GOODBYE" ) ), // icon
+ tr( "MEN_OP_GOODBYE" ), // menu title
+ tr( "STS_OP_GOODBYE" ), // status tip
+ 0, // accelerator (not set)
+ dsk, // parent
+ false, // togglable flag (no)
+ this, // action receiver
+ SLOT( goodbye() ) ); // action slot
// create menus
- int aMenuId;
- aMenuId = createMenu( tr( "MEN_FILE" ), -1, -1 );
- createMenu( separator(), aMenuId, -1, 10 );
- aMenuId = createMenu( tr( "MEN_FILE_HELLO" ), aMenuId, -1, 10 );
- createMenu( 190, aMenuId );
-
- aMenuId = createMenu( tr( "MEN_HELLO" ), -1, -1, 30 );
- createMenu( 901, aMenuId, 10 );
+ int menuId;
+ menuId = createMenu( tr( "MEN_FILE" ), -1, -1 ); // File menu
+ createMenu( separator(), menuId, -1, 10 ); // add separator to File menu
+ menuId = createMenu( tr( "MEN_FILE_HELLO" ), menuId, -1, 10 ); // File - Hello submenu
+ createMenu( OpTestMe, menuId ); // File - Hello - Test me
+ menuId = createMenu( tr( "MEN_HELLO" ), -1, -1, 30 ); // Hello menu
+ createMenu( OpHello, menuId, 10 ); // Hello - Hello
+ createMenu( OpGoodbye, menuId, 10 ); // Hello - Goodbye
// create toolbars
- int aToolId = createTool ( tr( "TOOL_HELLO" ) );
- createTool( 901, aToolId );
+ int aToolId;
+ aToolId = createTool ( tr( "TOOL_TEST" ) ); // Test toolbar
+ createTool( OpTestMe, aToolId ); // Test - Test me
+ aToolId = createTool ( tr( "TOOL_HELLO" ) ); // Hello toolbar
+ createTool( OpHello, aToolId ); // Hello - Hello
+ createTool( OpGoodbye, aToolId ); // Hello - Goodbye
+
+ // set-up popup menu
+ QtxPopupMgr* mgr = popupMgr();
+ mgr->insert( action( OpHello ), -1, -1 ); // Hello
+ mgr->insert( action( OpGoodbye ), -1, -1 ); // Goodbye
+ mgr->insert( separator(), -1, -1 ); // -----------
+ mgr->insert( action( OpTestMe ), -1, -1 ); // Test me
+ QString baseRule = "client='ObjectBrowser' and selcount=1 and $component={'HELLO'}";
+ mgr->setRule( action( OpHello ), baseRule + " and isComponent", QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( OpGoodbye ), baseRule + " and !isComponent", QtxPopupMgr::VisibleRule );
}
-// Module's engine IOR
+/*!
+ \brief Get module engine IOR
+
+ Overloaded from SalomeApp_Module class.
+
+ \return string representing module engine IOR
+*/
QString HELLOGUI::engineIOR() const
{
- CORBA::String_var anIOR = getApp()->orb()->object_to_string( InitHELLOGen( getApp() ) );
+ init(); // initialize engine, if necessary
+ CORBA::String_var anIOR = getApp()->orb()->object_to_string( myEngine.in() );
return QString( anIOR.in() );
}
-// Module's activation
+/*!
+ \brief Get module icon.
+
+ Overloaded from CAM_Module class.
+
+ Load and return the module icon pixmap. This icon is shown
+ in the Object browser, in modules toolbar, etc.
+
+ Default implementation uses iconName() function to retrieve the name
+ of the image file to be used as the module icon; tries to load this
+ file from module's resources and create pixmap from it.
+ Returns valid QPixmap instance if image is loaded correctly.
+ This function can be customized to provide another way to get module icon.
+
+ \return module icon pixmap
+ \sa iconName()
+*/
+QPixmap HELLOGUI::moduleIcon() const
+{
+ // nothing to do, in this example just call the parent implementation
+ return SalomeApp_Module::moduleIcon();
+}
+
+/*!
+ \brief Get module icon's file name.
+
+ Overloaded from CAM_Module class.
+
+ This function is used to get module icon image file name.
+ Default implementation tries to retrieve the name of the
+ icon file from the application using moduleIcon() function, which
+ in its turn retrieves the information about the module icon
+ from the configuration file (e.g. SalomeApp.xml, LightApp.xml).
+ This function can be customized to provide another way to get module icon's
+ file name.
+
+ \return module icon file name
+ \sa moduleIcon()
+*/
+QString HELLOGUI::iconName() const
+{
+ // nothing to do, in this example just call the parent implementation
+ return SalomeApp_Module::iconName();
+}
+
+/*!
+ \brief Request dockable windows to be available when module is active.
+
+ Overloaded from LightApp_Module class.
+
+ Fills and returns the list of dockable windows which should be
+ available when the module is active. It is a map of integer values
+ where \c key is an enumerator from LightApp_Application::WindowTypes
+ enumeration, specifying window type, and \c value is an enumerator
+ from Qt::DockWidgetArea, specifying the window's default position
+ in the main window layout.
+
+ Empty map means no dockable windows available when the module is active.
+
+ \param theMap this map should be filled to specify the list of
+ required dockable windows withe their default positions
+*/
+void HELLOGUI::windows( QMap<int, int>& theMap ) const
+{
+ // want Object browser, in the left area
+ theMap.insert( SalomeApp_Application::WT_ObjectBrowser,
+ Qt::LeftDockWidgetArea );
+ // want Python console, in the bottom area
+ theMap.insert( SalomeApp_Application::WT_PyConsole,
+ Qt::BottomDockWidgetArea );
+}
+
+/*!
+ \brief Request view windows (types) to be activated when module is activated..
+
+ Overloaded from LightApp_Module class.
+
+ Fills and returns the list of 3D/2D view windows types compatible
+ with this module. The views of the specified type(s) will be automatically
+ activated (raised to the top of view stack) each time when the module
+ is activated by the user (the views will be automatically created if they
+ do not exist at the module activation).
+ Empty list means no compatible view windows for the module.
+
+ Example:
+ \code
+ theList.append( OCCViewer_Viewer::Type() );
+ theList.append( SVTK_Viewer::Type() );
+ \endcode
+
+ \param theList this list should be filled to specify the list of
+ compatible view window types
+*/
+void HELLOGUI::viewManagers( QStringList& /*theList*/ ) const
+{
+ // no compatible view managers, nothing to do here
+}
+
+/*!
+ \brief Create popup selection handler.
+
+ Overloaded from LightApp_Module class.
+
+ This function can be used to create custom popup menu handler.
+ The application takes ownership over the returned pointer,
+ so you should not destroy it.
+
+ This function is part of the context popup menu management mechanism.
+ Selection object (instance of LightApp_Selection class or its successor)
+ analizes the currently selected items and defines selection-dependant
+ variables which are processed by the popup manager (QtxPopupMgr class).
+
+ These variables can be included into the lexical constructions, named
+ "rules", which are associated with the popup menu actions (refer to the
+ QtxPopupMgr class for more details).
+
+ Exampe:
+ \code
+ // obtain popup manager
+ QtxPopupMgr* mgr = popupMgr();
+ // create new action, with ID = 100
+ createAction( 100, "Action", QIcon(), "Action", "My action", 0, application()->desktop(),
+ false, this, SLOT( OnMyAction() ) );
+ // define popup rule for action
+ QString rule = "client='ObjectBrowser' and $type in {'MyType1' 'MyType2'} and selcount=1";
+ // set visibility rule for action
+ mgr->setRule( 100, rule, QtxPopupMgr::VisibleRule );
+ \endcode
+
+ In the above code, \a selcount variable is automatically defined
+ by LightApp_Selection class, but \a type variable should be set by
+ the successor class. Note, that LightApp_Selection class implements
+ several useful variables which can be used in the lexical rules.
+
+ \return new selection object
+ \sa contextMenuPopup()
+*/
+LightApp_Selection* HELLOGUI::createSelection() const
+{
+ // nothing to do, in this example just call the parent implementation
+ // see also initialize()
+ return SalomeApp_Module::createSelection();
+}
+
+/*!
+ \brief Create displayer object.
+
+ Overloaded from LightApp_Module class.
+
+ This function can be used to create and return custom displayer object.
+ The application does not take the ownership over the returned value.
+
+ Displayer is a part of the presentations management system.
+ If can be used to implement visualization operations, like create, show
+ or hide presentation in the viewer of specific type, etc.
+
+ \return pointer to the module displayer
+ */
+LightApp_Displayer* HELLOGUI::displayer()
+{
+ // nothing to do, in this example just call the parent implementation
+ return SalomeApp_Module::displayer();
+}
+
+/*!
+ \brief Create context popup menu.
+
+ Overloaded from CAM_Module class.
+
+ This function can be used to customize context popup menu management.
+ The module should fill \a menu with the items (e.g. by inserting own
+ QAction items). The menu contents can be context-depending, the parameter
+ \a type can be used to test the context of the popup menu invocation
+ (e.g. "ObjectBrowser").
+ Parameter \a title can be used to return the string value to be used
+ popup menu title if required.
+
+ Default implementation from LightApp_Module class calls createSelection()
+ function to create popup selection handler and initialized the popup menu
+ using popup manager.
+
+ \param type popup menu context
+ \param menu pointer to the popup menu
+ \param title custom popup menu title can be returned here
+ \sa createSelection()
+*/
+void HELLOGUI::contextMenuPopup( const QString& type, QMenu* menu, QString& title )
+{
+ // nothing to do, in this example just call the parent implementation
+ // see also initialize()
+ return SalomeApp_Module::contextMenuPopup( type, menu, title );
+}
+
+/*!
+ \brief Export module preferences.
+
+ Overloaded from LightApp_Module class.
+
+ This function is invoked only once when the common "Preferences"
+ dialog box is first time activated by the user (via the "File/Preferences"
+ menu command) or when module is first time activated.
+
+ This function should be used to export module preferences to the
+ common "Preferences" dialog box and associate them with the corresponding
+ widgets. The preferences items are arranged to the tree-like structure, where
+ top-level items represent just a containers for the underlying items.
+ Each low-level preferences item is linked to the resources item (via "section"
+ and "parameter" attributes). See QtxResourceMgr class for more details about
+ resources management.
+
+ Example:
+ \code
+ // create top-level preferences tab page
+ int settingsId = addPreference( "Settings" );
+ // create general settings group box
+ int generalId = addPreference( tr( "General" ), settingsId );
+ // set group box property - number of columns - to 2
+ setPreferenceProperty( generalId, "columns", 2 );
+ // create shading color preferences item (color button)
+ addPreference( "Shading color", generalId, LightApp_Preferences::Color,
+ "HELLO", "shading_color" );
+ // create precision preferences item (spin box)
+ int precisionId = addPreference( tr( "GEOM_PREF_length_precision" ), generalId,
+ LightApp_Preferences::IntSpin, "HELLO", "precision" );
+ // set precision preferences item properties
+ setPreferenceProperty( precisionId, "min", 0 );
+ setPreferenceProperty( precisionId, "max", 10 );
+ \endcode
+
+ \sa preferencesChanged()
+*/
+void HELLOGUI::createPreferences()
+{
+ // no module preferences, nothing to do here
+}
+
+/*!
+ \brief Process preference item change event.
+
+ Overloaded from LightApp_Module class.
+
+ This function is called every time when the preference item
+ owned by this module is changed by the user (usually this occurs when
+ the user presses "OK" or "Apply" button in the "Preferences" dialog box).
+
+ The module can perform any specific actions if necessary to response
+ to the preferences changes.
+
+ \param section resources item section name
+ \param parameter resources item parameter name
+
+ \sa createPreferences()
+*/
+void HELLOGUI::preferencesChanged( const QString& section, const QString& parameter )
+{
+ // nothing to do, in this example just call the parent implementation
+ SalomeApp_Module::preferencesChanged( section, parameter );
+}
+
+/*!
+ \brief Store visual state.
+
+ Overloaded from SalomeApp_Module class.
+
+ This method is called just before the study document is saved,
+ so the module has a possibility to store any visual parameters
+ in the AttributeParameter study attribute (if required).
+
+ \param savePoint save point unique identifier
+*/
+void HELLOGUI::storeVisualParameters( int /*savePoint*/ )
+{
+ // no specific visual state, nothing to do here
+}
+
+/*!
+ \brief Restore visual state.
+
+ Overloaded from SalomeApp_Module class.
+
+ This method is called after the study document is opened,
+ so the module has a possibility to restore the visual parameters
+ from the AttributeParameter study attribute (if required).
+
+ \param savePoint save point unique identifier
+*/
+void HELLOGUI::restoreVisualParameters( int /*savePoint*/ )
+{
+ // no specific visual state, nothing to do here
+}
+
+/*!
+ \brief Handle active study changing action.
+
+ Overloaded from LightApp_Module class.
+
+ This function is called each time when the active study is changed
+ (usually this happens when users switches between different studies'
+ desktops).
+
+ Can be used to perform any relevant actions.
+*/
+void HELLOGUI::studyActivated()
+{
+ // no any specific action required, nothing to do here
+}
+
+/*!
+ \brief Check if the module can perform "copy" operation.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general copy/paste mechanism.
+
+ Can be re-implemented to customize the copy/paste handling
+ in the module. Default implementation returns \c false.
+
+ \return \c true if the module can perform "copy" operation or \c false otherwise
+ \sa canPaste(), copy(), paste()
+*/
+bool HELLOGUI::canCopy() const
+{
+ // copy/paste is not supported, in this example just call the parent implementation
+ return SalomeApp_Module::canCopy();
+}
+
+/*!
+ \brief Check if the module can perform "paste" operation.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general copy/paste mechanism.
+
+ Can be re-implemented to customize the copy/paste handling
+ in the module. Default implementation returns \c false.
+
+ \return \c true if the module can perform "paste" operation or \c false otherwise
+ \sa canCopy(), copy(), paste()
+*/
+bool HELLOGUI::canPaste() const
+{
+ // copy/paste is not supported, in this example just call the parent implementation
+ return SalomeApp_Module::canPaste();
+}
+
+/*!
+ \brief Perform "copy" operation.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general copy/paste mechanism.
+
+ Can be re-implemented to customize the copy/paste handling
+ in the module. Default implementation does nothing.
+
+ \sa canCopy(), canPaste(), paste()
+*/
+void HELLOGUI::copy()
+{
+ // copy/paste is not supported, nothing to do here
+}
+
+/*!
+ \brief Perform "paste" operation.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general copy/paste mechanism.
+
+ Can be re-implemented to customize the copy/paste handling
+ in the module. Default implementation does nothing.
+
+ \sa canCopy(), canPaste(), copy()
+*/
+void HELLOGUI::paste()
+{
+ // copy/paste is not supported, nothing to do here
+}
+
+/*!
+ \brief Check if the module allows "drag" operation of its objects.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general drag-n-drop mechanism.
+ The goal of this function is to check data object passed as a parameter
+ and decide if it can be dragged or no.
+
+ \param what data object being tested for drag operation
+ \return \c true if module allows dragging of the specified object
+ \sa isDropAccepted(), dropObjects()
+*/
+bool HELLOGUI::isDraggable( const SUIT_DataObject* what ) const
+{
+ // we allow dragging any HELLO object, except the top-level component
+ const SalomeApp_ModuleObject* aModObj = dynamic_cast<const SalomeApp_ModuleObject*>( what );
+ return ( aModObj == 0 );
+}
+
+/*!
+ \brief Check if the module allows "drop" operation on the given object.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general drag-n-drop mechanism.
+ The goal of this function is to check data object passed as a parameter
+ and decide if it can be used as a target for the "drop" operation.
+ The processing of the drop operation itself is done in the dropObjects() function.
+
+ \param where target data object
+ \return \c true if module supports dropping on the \a where data object
+ \sa isDraggable(), dropObjects()
+*/
+bool HELLOGUI::isDropAccepted( const SUIT_DataObject* where ) const
+{
+ // we allow dropping of all objects
+ // (temporarily implementation, we also need to check objects being dragged)
+ return true;
+}
+
+/*!
+ \brief Complete drag-n-drop operation.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of the general drag-n-drop mechanism.
+ Its goal is to handle dropping of the objects being dragged according
+ to the chosen operation (copy or move). The dropping is performed in the
+ context of the parent data object \a where and the \a row (position in the
+ children index) at which the data should be dropped. If \a row is equal to -1,
+ this means that objects are added to the end of the children list.
+
+ \param what objects being dropped
+ \param where target data object
+ \param row child index at which the drop operation is performed
+ \param action drag-n-drop operation (Qt::DropAction) - copy or move
+
+ \sa isDraggable(), isDropAccepted()
+*/
+void HELLOGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* where,
+ const int row, Qt::DropAction action )
+{
+ if (action != Qt::CopyAction && action != Qt::MoveAction)
+ return; // unsupported action
+
+ // get parent object
+ SalomeApp_DataObject* dataObj = dynamic_cast<SalomeApp_DataObject*>( where );
+ if ( !dataObj ) return; // wrong parent
+ _PTR(SObject) parentObj = dataObj->object();
+
+ // collect objects being dropped
+ HELLO_ORB::object_list_var objects = new HELLO_ORB::object_list();
+ objects->length( what.count() );
+ int count = 0;
+ for ( int i = 0; i < what.count(); i++ ) {
+ dataObj = dynamic_cast<SalomeApp_DataObject*>( what[i] );
+ if ( !dataObj ) continue; // skip wrong objects
+ _PTR(SObject) sobj = dataObj->object();
+ objects[i] = _CAST(SObject, sobj)->GetSObject();
+ count++;
+ }
+ objects->length( count );
+
+ // call engine function
+ engine()->copyOrMove( objects.in(), // what
+ _CAST(SObject, parentObj)->GetSObject(), // where
+ row, // row
+ action == Qt::CopyAction ); // isCopy
+
+ // update Object browser
+ getApp()->updateObjectBrowser( false );
+}
+
+/*!
+ \brief Module activation.
+
+ Overloaded from CAM_Module class.
+
+ This function is called each time the module is activated
+ by the user. It is usually used to perform any relevant actions,
+ like displaying menus and toolbars, connecting specific signals/slots, etc.
+
+ \param theStudy current study object
+ \return \c true if activation is completed correctly or \c false
+ if module activation fails
+
+ \sa deactivateModule()
+*/
bool HELLOGUI::activateModule( SUIT_Study* theStudy )
{
+ // call parent implementation
bool bOk = SalomeApp_Module::activateModule( theStudy );
+ // show own menus
setMenuShown( true );
+ // show own toolbars
setToolShown( true );
+ // return the activation status
return bOk;
}
-// Module's deactivation
+/*!
+ \brief Module deactivation.
+
+ Overloaded from CAM_Module class.
+
+ This function is called each time the module is deactivated
+ by the user. It is usually used to perform any relevant actions,
+ like hiding menus and toolbars, disconnecting specific signals/slots, etc.
+
+ \param theStudy current study object
+ \return \c true if deactivation is completed correctly or \c false
+ if module deactivation fails
+
+ \sa activateModule()
+*/
bool HELLOGUI::deactivateModule( SUIT_Study* theStudy )
{
+ // hide own menus
setMenuShown( false );
+ // hide own toolbars
setToolShown( false );
+ // call parent implementation and return the activation status
return SalomeApp_Module::deactivateModule( theStudy );
}
-// Default windows
-void HELLOGUI::windows( QMap<int, int>& theMap ) const
+/*!
+ \brief Create specific operation object.
+
+ Overloaded from LightApp_Module class.
+
+ This function is a part of operation management mechanism.
+ It can be used to create module specific operations, if module
+ implements transaction handling basing on the GUI operations instances.
+
+ This function is automatically called from startOperation() function.
+ After operation is created, it can be started/stopped/paused/resumed etc.
+ Compatibility between diferent simultaneously running operations is also
+ checked by invoking of the corresponding methods of the LightApp_Operation
+ class.
+
+ The application takes ownership over the returned pointer,
+ so you should not destroy it.
+
+ Default implementation in LightApp_Module class processes common Show/Hide
+ operations.
+
+ \param id unique operation identifier
+ \return new operation object
+*/
+LightApp_Operation* HELLOGUI::createOperation( const int id ) const
{
- theMap.clear();
- theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
- theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+ // no specific operations, in this example just call the parent implementation
+ return SalomeApp_Module::createOperation( id );
}
-// Action slot
-void HELLOGUI::OnMyNewItem()
+/*!
+ \brief Action slot: Test me
+*/
+void HELLOGUI::testMe()
{
- SUIT_MessageBox::warning( getApp()->desktop(),tr( "INF_HELLO_BANNER" ), tr( "INF_HELLO_MENU" ) );
+ SUIT_MessageBox::information( getApp()->desktop(),
+ tr( "INF_TESTME_TITLE" ),
+ tr( "INF_TESTME_MSG" ),
+ tr( "BUT_OK" ) );
}
-// Action slot
-void HELLOGUI::OnGetBanner()
+/*!
+ \brief Action slot: Hello
+*/
+void HELLOGUI::hello()
{
- // Dialog to get the Name
- bool ok = FALSE;
- QString myName = QInputDialog::getText( getApp()->desktop(), tr( "QUE_HELLO_LABEL" ), tr( "QUE_HELLO_NAME" ),
- QLineEdit::Normal, QString::null, &ok );
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ _PTR(Study) studyDS = study->studyDS();
- if ( ok && !myName.isEmpty()) // if we got a name, get a HELLO component and ask for makeBanner
- {
- HELLO_ORB::HELLO_Gen_ptr hellogen = HELLOGUI::InitHELLOGen( getApp() );
- QString banner = hellogen->makeBanner( (const char*)myName.toLatin1() );
- SUIT_MessageBox::information( getApp()->desktop(), tr( "INF_HELLO_BANNER" ), banner, tr( "BUT_OK" ) );
+ // request user name
+ bool ok;
+ QString name = QInputDialog::getText( getApp()->desktop(), tr( "QUE_HELLO_TITLE" ), tr( "QUE_ENTER_NAME" ),
+ QLineEdit::Normal, QString::null, &ok );
+
+ if ( ok && !name.trimmed().isEmpty() ) {
+ // say hello to SALOME
+ HELLO_ORB::status status = engine()->hello( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+
+ // update Object browser
+ getApp()->updateObjectBrowser(true);
+
+ // process operation status
+ switch( status ) {
+ case HELLO_ORB::OP_OK:
+ // everything's OK
+ SUIT_MessageBox::information( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "INF_HELLO_MSG" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_ALREADY_MET:
+ // error: already said hello
+ SUIT_MessageBox::warning( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "ERR_HELLO_ALREADY_MET" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_UNKNOWN:
+ default:
+ // other errors
+ SUIT_MessageBox::critical( getApp()->desktop(),
+ tr( "INF_HELLO_TITLE" ),
+ tr( "ERR_ERROR" ),
+ tr( "BUT_OK" ) );
+ break;
+ }
+ }
+}
+
+/*!
+ \brief Action slot: Goodbye
+*/
+void HELLOGUI::goodbye()
+{
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
+ _PTR(Study) studyDS = study->studyDS();
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+
+ QString name;
+
+ // get selection
+ SALOME_ListIO selected;
+ aSelMgr->selectedObjects( selected );
+ if ( selected.Extent() == 1 ) {
+ Handle(SALOME_InteractiveObject) io = selected.First();
+ _PTR(SObject) so = studyDS->FindObjectID( io->getEntry() );
+ if ( so ) {
+ _PTR(SComponent) comp = so->GetFatherComponent();
+ if ( comp && comp->ComponentDataType() == "HELLO" && io->getEntry() != comp->GetID() ) {
+ name = so->GetName().c_str();
+ }
+ }
+ }
+
+ // request user name if not specified
+ if ( name.isEmpty() ) {
+ bool ok;
+ name = QInputDialog::getText( getApp()->desktop(), tr( "QUE_GOODBYE_TITLE" ), tr( "QUE_ENTER_NAME" ),
+ QLineEdit::Normal, QString::null, &ok );
+ }
+
+ if ( !name.trimmed().isEmpty() ) {
+ // say goodby to SALOME
+ HELLO_ORB::status status = engine()->goodbye( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+
+ // update Object browser
+ getApp()->updateObjectBrowser(true);
+
+ // process operation status
+ switch( status ) {
+ case HELLO_ORB::OP_OK:
+ // everything's OK
+ SUIT_MessageBox::information( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "INF_GOODBYE_MSG" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_DID_NOT_MEET:
+ // error: did not say hello yet
+ SUIT_MessageBox::warning( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "ERR_GOODBYE_DID_NOT_MEET" ).arg( name ),
+ tr( "BUT_OK" ) );
+ break;
+ case HELLO_ORB::OP_ERR_UNKNOWN:
+ default:
+ // other errors
+ SUIT_MessageBox::critical( getApp()->desktop(),
+ tr( "INF_GOODBYE_TITLE" ),
+ tr( "ERR_ERROR" ),
+ tr( "BUT_OK" ) );
+ break;
+ }
+ }
+}
+
+/*!
+ \brief Perform internal initialization
+
+ In particular, this function initializes module engine.
+*/
+void HELLOGUI::init()
+{
+ // initialize HELLO module engine (load, if necessary)
+ if ( CORBA::is_nil( myEngine ) ) {
+ Engines::EngineComponent_var comp =
+ SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "HELLO" );
+ myEngine = HELLO_ORB::HELLO_Gen::_narrow( comp );
}
}
// Export the module
extern "C" {
+ // FACTORY FUNCTION: create an instance of the Hello module GUI
CAM_Module* createModule()
{
return new HELLOGUI();
}
+ // VERSIONING FUNCTION: get Hello module's version identifier
+ char* getModuleVersion()
+ {
+ return (char*)HELLO_VERSION_STR; // HELLO_VERSION_STR is defined in HELLO_version.h
+ }
}
-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
+// 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
+// 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
-//
-// HELLOGUI : HELLO component GUI implemetation
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
+// HELLOGUI : HELLO component GUI implemetation
+
#ifndef _HELLOGUI_H_
#define _HELLOGUI_H_
#include CORBA_CLIENT_HEADER(HELLO_Gen)
class SalomeApp_Application;
+
class HELLOGUI: public SalomeApp_Module
{
Q_OBJECT
+ //! operations
+ enum {
+ OpTestMe = 190, //!< Test me
+ OpHello = 901, //!< Hello
+ OpGoodbye = 902, //!< Goodbye
+ };
+
public:
HELLOGUI();
+ ~HELLOGUI();
+
+ static HELLO_ORB::HELLO_Gen_var engine();
+
+ virtual void initialize( CAM_Application* app );
+ virtual QString engineIOR() const;
+
+ virtual QPixmap moduleIcon() const;
+ virtual QString iconName() const;
+
+ virtual void windows( QMap<int, int>& theMap ) const;
+ virtual void viewManagers( QStringList& theList ) const;
- void initialize( CAM_Application* );
- QString engineIOR() const;
- void windows( QMap<int, int>& ) const;
+ virtual LightApp_Selection* createSelection() const;
+ virtual LightApp_Displayer* displayer();
- static HELLO_ORB::HELLO_Gen_ptr InitHELLOGen( SalomeApp_Application* );
+ virtual void contextMenuPopup( const QString& type, QMenu* menu, QString& title );
+
+ virtual void createPreferences();
+ virtual void preferencesChanged( const QString& section, const QString& parameter );
+
+ virtual void storeVisualParameters( int savePoint );
+ virtual void restoreVisualParameters( int savePoint );
+
+ virtual void studyActivated();
+
+ virtual bool canCopy() const;
+ virtual bool canPaste() const;
+ virtual void copy();
+ virtual void paste();
+
+ virtual bool isDraggable( const SUIT_DataObject* what ) const;
+ virtual bool isDropAccepted( const SUIT_DataObject* where ) const;
+ virtual void dropObjects( const DataObjectList& what, SUIT_DataObject* where,
+ const int row, Qt::DropAction action );
public slots:
- bool deactivateModule( SUIT_Study* );
- bool activateModule( SUIT_Study* );
+ virtual bool activateModule( SUIT_Study* theStudy );
+ virtual bool deactivateModule( SUIT_Study* theStudy );
+
+protected:
+ virtual LightApp_Operation* createOperation( const int id ) const;
protected slots:
- void OnMyNewItem();
- void OnGetBanner();
+ void testMe();
+ void hello();
+ void goodbye();
+
+private:
+ static void init();
+
+private:
+ static HELLO_ORB::HELLO_Gen_var myEngine;
};
-#endif
+#endif // _HELLOGUI_H_
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
-<TS version="1.1" >
+<TS version="2.0" language="en_US">
<context>
<name>@default</name>
<message>
- <source>ICON_GET_BANNER</source>
- <translation>ExecHELLO.png</translation>
+ <source>ICON_HELLO</source>
+ <translation>HELLO.png</translation>
+ </message>
+ <message>
+ <source>ICON_OP_HELLO</source>
+ <translation>handshake.png</translation>
+ </message>
+ <message>
+ <source>ICON_OP_GOODBYE</source>
+ <translation>goodbye.png</translation>
+ </message>
+ <message>
+ <source>ICON_OP_TESTME</source>
+ <translation>testme.png</translation>
</message>
</context>
</TS>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>MEN_FILE</source>
- <translation>&File</translation>
- </message>
- <message>
- <source>MEN_FILE_HELLO</source>
- <translation>Hello</translation>
- </message>
- <message>
- <source>MEN_GET_BANNER</source>
- <translation>Get banner</translation>
- </message>
- <message>
- <source>MEN_HELLO</source>
- <translation>HELLO</translation>
- </message>
- <message>
- <source>MEN_MY_NEW_ITEM</source>
- <translation>My menu item</translation>
- </message>
- <message>
- <source>STS_GET_BANNER</source>
- <translation>Get HELLO banner</translation>
- </message>
- <message>
- <source>STS_MY_NEW_ITEM</source>
- <translation>Call my menu item</translation>
- </message>
- <message>
- <source>TLT_GET_BANNER</source>
- <translation>Get HELLO banner</translation>
- </message>
- <message>
- <source>TLT_MY_NEW_ITEM</source>
- <translation>My menu item</translation>
- </message>
- <message>
- <source>TOOL_HELLO</source>
- <translation>HELLO</translation>
- </message>
- </context>
- <context>
- <name>HELLOGUI</name>
- <message>
- <source>BUT_OK</source>
- <translation>OK</translation>
- </message>
- <message>
- <source>INF_HELLO_BANNER</source>
- <translation>HELLO Information</translation>
- </message>
- <message>
- <source>INF_HELLO_MENU</source>
- <translation>This is just a test</translation>
- </message>
- <message>
- <source>QUE_HELLO_LABEL</source>
- <translation>Name Import</translation>
- </message>
- <message>
- <source>QUE_HELLO_NAME</source>
- <translation>Please, Enter your name</translation>
- </message>
- </context>
+<TS version="2.0" language="en_US">
+<context>
+ <name>HELLOGUI</name>
+ <message>
+ <source>MEN_FILE</source>
+ <translation>&File</translation>
+ </message>
+ <message>
+ <source>MEN_FILE_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>MEN_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>MEN_OP_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>MEN_OP_GOODBYE</source>
+ <translation>Goodbye</translation>
+ </message>
+ <message>
+ <source>MEN_OP_TESTME</source>
+ <translation>Test me</translation>
+ </message>
+ <message>
+ <source>STS_OP_HELLO</source>
+ <translation>Say hello to SALOME</translation>
+ </message>
+ <message>
+ <source>STS_OP_GOODBYE</source>
+ <translation>Say goodbye to SALOME</translation>
+ </message>
+ <message>
+ <source>STS_OP_TESTME</source>
+ <translation>Invoke test menu item</translation>
+ </message>
+ <message>
+ <source>TLT_OP_HELLO</source>
+ <translation>Hi, there!</translation>
+ </message>
+ <message>
+ <source>TLT_OP_GOODBYE</source>
+ <translation>Bye-bye!</translation>
+ </message>
+ <message>
+ <source>TLT_OP_TESTME</source>
+ <translation>Test me</translation>
+ </message>
+ <message>
+ <source>TOOL_TEST</source>
+ <translation>Test</translation>
+ </message>
+ <message>
+ <source>TOOL_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>BUT_OK</source>
+ <translation>OK</translation>
+ </message>
+ <message>
+ <source>INF_TESTME_TITLE</source>
+ <translation>HELLO: test me</translation>
+ </message>
+ <message>
+ <source>INF_TESTME_MSG</source>
+ <translation>This is just a test of the custom menu action</translation>
+ </message>
+ <message>
+ <source>QUE_ENTER_NAME</source>
+ <translation>Please, enter your name</translation>
+ </message>
+ <message>
+ <source>QUE_HELLO_TITLE</source>
+ <translation>Say hello to SALOME</translation>
+ </message>
+ <message>
+ <source>INF_HELLO_TITLE</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>INF_HELLO_MSG</source>
+ <translation>Hello, %1!</translation>
+ </message>
+ <message>
+ <source>ERR_HELLO_ALREADY_MET</source>
+ <translation>%1, we already met!</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR</source>
+ <translation>Unknown error</translation>
+ </message>
+ <message>
+ <source>QUE_GOODBYE_TITLE</source>
+ <translation>Say goodbye to SALOME</translation>
+ </message>
+ <message>
+ <source>INF_GOODBYE_TITLE</source>
+ <translation>Goodbye</translation>
+ </message>
+ <message>
+ <source>INF_GOODBYE_MSG</source>
+ <translation>Bye-bye, %1!</translation>
+ </message>
+ <message>
+ <source>ERR_GOODBYE_DID_NOT_MEET</source>
+ <translation>%1, we did not say hello yet!</translation>
+ </message>
+</context>
</TS>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<!--
- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-
- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-
- 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
-
--->
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>MEN_FILE</source>
- <translation>&File</translation>
- </message>
- <message>
- <source>MEN_FILE_HELLO</source>
- <translation>Hello</translation>
- </message>
- <message>
- <source>MEN_GET_BANNER</source>
- <translation>Get banner</translation>
- </message>
- <message>
- <source>MEN_HELLO</source>
- <translation>HELLO</translation>
- </message>
- <message>
- <source>MEN_MY_NEW_ITEM</source>
- <translation>My menu item</translation>
- </message>
- <message>
- <source>STS_GET_BANNER</source>
- <translation>Get HELLO banner</translation>
- </message>
- <message>
- <source>STS_MY_NEW_ITEM</source>
- <translation>Call my menu item</translation>
- </message>
- <message>
- <source>TLT_GET_BANNER</source>
- <translation>Get HELLO banner</translation>
- </message>
- <message>
- <source>TLT_MY_NEW_ITEM</source>
- <translation>My menu item</translation>
- </message>
- <message>
- <source>TOOL_HELLO</source>
- <translation>HELLO</translation>
- </message>
- </context>
- <context>
- <name>HELLOGUI</name>
- <message>
- <source>BUT_OK</source>
- <translation>OK</translation>
- </message>
- <message>
- <source>INF_HELLO_BANNER</source>
- <translation>Information HELLO</translation>
- </message>
- <message>
- <source>INF_HELLO_MENU</source>
- <translation>Ceci est un simple test</translation>
- </message>
- <message>
- <source>QUE_HELLO_LABEL</source>
- <translation>Import Prnom</translation>
- </message>
- <message>
- <source>QUE_HELLO_NAME</source>
- <translation>Entrez votre prnom, s'il vous plait</translation>
- </message>
- </context>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>HELLOGUI</name>
+ <message>
+ <source>MEN_FILE</source>
+ <translation>&Fichier</translation>
+ </message>
+ <message>
+ <source>MEN_FILE_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>MEN_HELLO</source>
+ <translation>Hello</translation>
+ </message>
+ <message>
+ <source>MEN_OP_HELLO</source>
+ <translation>Salut</translation>
+ </message>
+ <message>
+ <source>MEN_OP_GOODBYE</source>
+ <translation>Au revoir</translation>
+ </message>
+ <message>
+ <source>MEN_OP_TESTME</source>
+ <translation>Essayez moi</translation>
+ </message>
+ <message>
+ <source>STS_OP_HELLO</source>
+ <translation>Saluer SALOME</translation>
+ </message>
+ <message>
+ <source>STS_OP_GOODBYE</source>
+ <translation>Dire au revoir à SALOME</translation>
+ </message>
+ <message>
+ <source>STS_OP_TESTME</source>
+ <translation>Test d'une action personnalisée dans le menu</translation>
+ </message>
+ <message>
+ <source>TLT_OP_HELLO</source>
+ <translation>Salut à toi !</translation>
+ </message>
+ <message>
+ <source>TLT_OP_GOODBYE</source>
+ <translation>Au revoir !</translation>
+ </message>
+ <message>
+ <source>TLT_OP_TESTME</source>
+ <translation>Essayez moi</translation>
+ </message>
+ <message>
+ <source>TOOL_TEST</source>
+ <translation>Test</translation>
+ </message>
+ <message>
+ <source>TOOL_HELLO</source>
+ <translation>Salut</translation>
+ </message>
+ <message>
+ <source>BUT_OK</source>
+ <translation>OK</translation>
+ </message>
+ <message>
+ <source>INF_TESTME_TITLE</source>
+ <translation>HELLO: essayez moi</translation>
+ </message>
+ <message>
+ <source>INF_TESTME_MSG</source>
+ <translation>Ce n'est qu'un test d'action de menu personnalisée</translation>
+ </message>
+ <message>
+ <source>QUE_ENTER_NAME</source>
+ <translation>Indiquez votre nom</translation>
+ </message>
+ <message>
+ <source>QUE_HELLO_TITLE</source>
+ <translation>Saluer SALOME</translation>
+ </message>
+ <message>
+ <source>INF_HELLO_TITLE</source>
+ <translation>Salut</translation>
+ </message>
+ <message>
+ <source>INF_HELLO_MSG</source>
+ <translation>Salut %1 !</translation>
+ </message>
+ <message>
+ <source>ERR_HELLO_ALREADY_MET</source>
+ <translation>%1, nous nous connaissons déjà !</translation>
+ </message>
+ <message>
+ <source>ERR_ERROR</source>
+ <translation>Erreur inconnue</translation>
+ </message>
+ <message>
+ <source>QUE_GOODBYE_TITLE</source>
+ <translation>Dire au revoir à SALOME</translation>
+ </message>
+ <message>
+ <source>INF_GOODBYE_TITLE</source>
+ <translation>Au revoir</translation>
+ </message>
+ <message>
+ <source>INF_GOODBYE_MSG</source>
+ <translation>Au revoir %1 !</translation>
+ </message>
+ <message>
+ <source>ERR_GOODBYE_DID_NOT_MEET</source>
+ <translation>%1, nous ne nous sommes pas encore rencontrés !</translation>
+ </message>
+</context>
</TS>
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# -* Makefile *-
# Author :
# Modified by : Alexander BORODIN (OCN) - autotools usage
$(GUI_CXXFLAGS) \
-I$(srcdir)/../HELLO \
-I$(top_builddir)/idl \
- -I$(top_builddir)/salome_adm/unix
+ -I$(top_builddir)
libHELLO_la_LDFLAGS = \
../../idl/libSalomeIDLHELLO.la \
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# 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 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.
#
-# 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
#
-# 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
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
# File : Makefile.in
# Author : (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-SUBDIRS = HELLO HELLOGUI
+SUBDIRS = HELLO
+
+if HELLO_ENABLE_GUI
+ SUBDIRS += HELLOGUI
+endif