The first step in the development process is the creation of the module tree file structure. 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:
+ HELLO1_SRC + build_configure + configure.ac + Makefile.am + HELLO_version.h.in + adm_local + Makefile.am + unix + Makefile.am + make_common_starter.am + config_files + Makefile.am + check_HELLO.m4 + check_GUI.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 + ExecHELLO.png + HELLOCatalog.xml.in + SalomeApp.xml + doc + Makefile.am + doxyfile.in + index.doc
Note that other files can be optionally present. For example, in some SALOME modules sources tree you can find such files as AUTHORS, INSTALL, ChangeLog, COPYING, NEWS, README, etc.
The usual way of the sources directory tree structure initial creation is to copy it from the existing SALOME module.
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.
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.
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).
These files are also a 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.
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.
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.
This is the CORBA IDL definition of the services implemented by SALOME HELLO module.
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 HELLO_Gen.idl file.
The src/HELLOGUI 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 Supervisor computation schemas, in Python scripts or/and in C++ implementation of other modules. A GUI library is necessary in the cases if it is planned to access to the module functionality from the SALOME GUI session via menu actions, dialog boxes and so on.
These files provide a description (internationalization) of GUI resources of the HELLO module. HELLO_msg_en.ts provides an English translation of the string resources used in a module. 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.
The resources folder usually includes different resource files used within the SALOME module. For example, HELLO.png file provides an icon of HELLO module to be shown in the SALOME GUI desktop. ExecHELLO.png is an icon for the makeBanner() function used in the menu and toolbar.
The XML description of the CORBA services provided by the HELLO module. This file is parsed by Supervisor and YACS module 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.
This file is essential for the module. It provides some parameters of the module which define module behavior in SALOME. In particular it should provide a section with the name corresponding to the name of a module ("HELLO" in this case) with the following parameters:
<section name="HELLO"> <parameter name="name" value="Hello"/> <parameter name="icon" value="HELLO.png"/> </section>
The "name" parameter defines GUI name of a module. The "icon" parameter defines a GUI icon of a module. The section "resources" also specifies the directory that contains resources of a module (icons, translation files, etc).
<section name="resources"> <parameter name="HELLO" value="${HELLO_ROOT_DIR}/share/salome/resources/hello"/> </section>
The Doxygen configuration file. The Doxygen is used to build this documentation. The file doxyfile.in provides a rules for the generation of module documentation.
An input file for the Doxygen, which provides a source of this documentation.