]> SALOME platform Git repositories - tools/hxx2salome.git/commitdiff
Salome HOME
*** empty log message ***
authorjyp <jyp>
Thu, 15 Dec 2005 10:54:02 +0000 (10:54 +0000)
committerjyp <jyp>
Thu, 15 Dec 2005 10:54:02 +0000 (10:54 +0000)
scripts/hxx2salome
scripts/template_src.tgz
src/hxx2salome.ui
src/hxx2salome.ui.h

index c7a25a3d33e4783732faae51bb6549f29f0487cd..c7c01c90b39eb955d4001d81d412109712df811f 100755 (executable)
@@ -32,6 +32,7 @@ usage()
     echo -e "                            (this file is also used for sourcing environment before compilation if it has sh or bash syntax,"
     echo -e "                             if the syntax is csh, it is not sourced and for compiling (-c option) environment must be set up before)"
     echo -e "    -s script_extension   : to use if your environment file name doesn't have extension"
+    echo -e "    -g                    : to create a gui part in your component building tree"
     echo -e "    -c                    : to compile after generation"
     echo -e "                            (use this option only if you don't have dependencies in your header or libraries"
     echo -e "                             if it is the case, you'll have to adapt your Makefile.in" 
@@ -174,7 +175,7 @@ generate_module_source()
 # outputs
     echo -e "\n  IDL file:"
     cat parse_result > hxx2salome_journal
-    echo -e "\n----------------- IDL file ------------------\n">>hxx2salome_journal
+    echo -e "\n----------------- IDL file ------------------\n" >> hxx2salome_journal
     cat code_idl >> hxx2salome_journal
     cat code_idl
     echo -e "\n----------------- hxx file ------------------\n" >> hxx2salome_journal
@@ -188,8 +189,16 @@ generate_module_source()
 #
     echo -e "\n-> Duplicate template module" | tee hxx2salome_journal
     tar xvfz ${gene_dir}/template_src.tgz >> hxx2salome_journal
-    mv TEMPLATE_SRC ${CLASS_NAME}_SRC
-    ${gene_dir}/renameSalomeModule -i TEMPLATE ${CLASS_NAME} ${CLASS_NAME}_SRC >> hxx2salome_journal
+    mv HXX2SALOME_GENERIC_CLASS_NAME_SRC ${CLASS_NAME}_SRC
+    ${gene_dir}/renameSalomeModule -i HXX2SALOME_GENERIC_CLASS_NAME ${CLASS_NAME} ${CLASS_NAME}_SRC >> hxx2salome_journal
+#
+    if [ $make_gui -eq 0 ]
+    then
+       echo -e "\n-> Delete GUI part from the tree" >> hxx2salome_journal
+       'rm' -rf ${CLASS_NAME}_SRC/src/${CLASS_NAME}GUI
+       sed "s/${CLASS_NAME}GUI//" < ${CLASS_NAME}_SRC/src/Makefile.in > /tmp/h2smkf.$$
+       mv /tmp/h2smkf.$$ ${CLASS_NAME}_SRC/src/Makefile.in
+    fi
 #
     echo -e "\n-> Substitute generated code in idl file"
     echo "// this idl file was generated by hxx2salome" > tmpfile
@@ -340,11 +349,12 @@ good_bye()
     echo -e "\trun Salome"
     echo -e "\tadd ${CLASS_NAME} to the Salome modules list"
     echo -e "\t\t(with the --modules option of the runSalome command or"
-    echo -e "\t\tby editing the ~/.salome_2.2.4/salome.launch file)"
+    echo -e "\t\tby editing your own per-user configuration file ~/.SalomeApprc.3.x.x)"
     echo -e "\nIf the header of your component includes other headers that are not in the same directories,"
-    echo -e "or if yout library has dependencies you want to specify,"
-    echo -e "you'll have to modify the following Makefile:in : "
+    echo -e "or if your library has dependencies you want to specify,"
+    echo -e "you'll have to modify the following files Makefile.in: "
     echo -e "\t\${${CLASS_NAME}_SRC_DIR}/src/${CLASS_NAME}/Makefile.in"
+    echo -e "\t\${${CLASS_NAME}_SRC_DIR}/src/${CLASS_NAME}GUI/Makefile.in"
 }
 
 launch_salome()
@@ -395,12 +405,14 @@ CPP_ROOT_DIR=
 NEW_COMPONENT_ROOT_DIR=
 NEW_COMPONENT_SRC_DIR=
 NEW_COMPONENT_BUILD_DIR=
+SHELL_EXT=sh
 do_compile=0
 do_launch=0
-#
+make_gui=0
+ #
 welcome # print some welcome info
 #
-while getopts "cs:e:h:l" Option
+while getopts "cs:e:h:lg" Option
 do
    case $Option in
      h) usage
@@ -411,6 +423,7 @@ do
            csh)  SHELL_EXT=csh;;      
            *)    SHELL_EXT=sh;;
        esac;;
+     g) make_gui=1;;
      c) do_compile=1;;
      l) do_launch=1;;
      *) echo "Unimplemented option chosen : $Option."
@@ -482,7 +495,7 @@ fi
 #
 # get class name
 #
-CLASS_NAME=`awk '$1 == "class" && $0 !~ /;/ {print $2}' ${hxx_file}`
+CLASS_NAME=`awk '$1 == "class" && $0 !~ /;/ {print $2}' ${hxx_file}|awk -F: '{print $1}'`
 echo "    Name of class :" $CLASS_NAME
 if [ ! $CLASS_NAME ]
 then
index d435bd659123e894040f95e06770560ca41efbaa..bf91f2a2c0d5699a5feafe14e528938092cc0417 100644 (file)
Binary files a/scripts/template_src.tgz and b/scripts/template_src.tgz differ
index 2e2ceb8bf3259dff2eda2357d5fbeaf9270908fe..b9f4a54f7beca4df1ac90a6f36e53a54b3d66071 100644 (file)
@@ -9,7 +9,7 @@
             <x>0</x>
             <y>0</y>
             <width>520</width>
-            <height>383</height>
+            <height>429</height>
         </rect>
     </property>
     <property name="caption">
     </widget>
     <widget class="QPushButton">
         <property name="name">
-            <cstring>CloseButton</cstring>
+            <cstring>GenButton</cstring>
         </property>
         <property name="geometry">
             <rect>
-                <x>390</x>
-                <y>340</y>
+                <x>30</x>
+                <y>380</y>
                 <width>86</width>
                 <height>28</height>
             </rect>
         </property>
         <property name="text">
-            <string>Close</string>
+            <string>Generate</string>
         </property>
     </widget>
     <widget class="QPushButton">
         <property name="name">
-            <cstring>GenButton</cstring>
+            <cstring>CloseButton</cstring>
         </property>
         <property name="geometry">
             <rect>
-                <x>30</x>
-                <y>340</y>
+                <x>390</x>
+                <y>380</y>
                 <width>86</width>
                 <height>28</height>
             </rect>
         </property>
         <property name="text">
-            <string>Generate</string>
+            <string>Close</string>
         </property>
     </widget>
     <widget class="QGroupBox">
                 <x>10</x>
                 <y>200</y>
                 <width>500</width>
-                <height>130</height>
+                <height>160</height>
             </rect>
         </property>
         <property name="title">
             <string>Output</string>
         </property>
-        <widget class="QPushButton">
+        <widget class="QLabel">
             <property name="name">
-                <cstring>OutputTreeButton</cstring>
+                <cstring>OutputTreeLabel</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>380</x>
+                    <x>30</x>
                     <y>30</y>
-                    <width>80</width>
+                    <width>140</width>
                     <height>30</height>
                 </rect>
             </property>
             <property name="text">
-                <string>Browse ...</string>
+                <string>Salome component tree</string>
             </property>
         </widget>
-        <widget class="QLabel">
+        <widget class="QLineEdit">
             <property name="name">
-                <cstring>OutputTreeLabel</cstring>
+                <cstring>OutputTreeText</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>30</x>
+                    <x>180</x>
                     <y>30</y>
-                    <width>140</width>
+                    <width>190</width>
+                    <height>30</height>
+                </rect>
+            </property>
+        </widget>
+        <widget class="QLabel">
+            <property name="name">
+                <cstring>textLabel1</cstring>
+            </property>
+            <property name="geometry">
+                <rect>
+                    <x>230</x>
+                    <y>120</y>
+                    <width>259</width>
                     <height>30</height>
                 </rect>
             </property>
             <property name="text">
-                <string>Salome component tree</string>
+                <string>(if checked, generation can take a long time)</string>
             </property>
         </widget>
-        <widget class="QLineEdit">
+        <widget class="QPushButton">
             <property name="name">
-                <cstring>OutputTreeText</cstring>
+                <cstring>OutputTreeButton</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>180</x>
+                    <x>380</x>
                     <y>30</y>
-                    <width>190</width>
+                    <width>80</width>
                     <height>30</height>
                 </rect>
             </property>
+            <property name="text">
+                <string>Browse ...</string>
+            </property>
         </widget>
         <widget class="QComboBox">
             <item>
         </widget>
         <widget class="QCheckBox">
             <property name="name">
-                <cstring>Compile</cstring>
+                <cstring>makeGUI</cstring>
             </property>
             <property name="geometry">
                 <rect>
                     <x>200</x>
                     <y>70</y>
-                    <width>210</width>
-                    <height>30</height>
+                    <width>241</width>
+                    <height>31</height>
                 </rect>
             </property>
             <property name="text">
-                <string>Compile Salome Component</string>
+                <string>Generate file structure for GUI</string>
             </property>
         </widget>
-        <widget class="QLabel">
+        <widget class="QCheckBox">
             <property name="name">
-                <cstring>textLabel1</cstring>
+                <cstring>Compile</cstring>
             </property>
             <property name="geometry">
                 <rect>
-                    <x>230</x>
-                    <y>90</y>
-                    <width>259</width>
+                    <x>200</x>
+                    <y>100</y>
+                    <width>210</width>
                     <height>30</height>
                 </rect>
             </property>
             <property name="text">
-                <string>(if checked, generation can take a long time)</string>
+                <string>Compile Salome Component</string>
             </property>
         </widget>
     </widget>
         <slot>ShellChoice_activated(int)</slot>
     </connection>
 </connections>
-<includes>
-    <include location="local" impldecl="in implementation">hxx2salome.ui.h</include>
-</includes>
 <variables>
     <variable>QString CppLibDir;</variable>
     <variable>QString SalomeDir;</variable>
index 2c64bdb0993697cf2b916804eb46b4dcf31e24f2..d72a91355bd6145057b950a22a0ba685c7f6b2bd 100644 (file)
@@ -206,6 +206,8 @@ void HXX2Salome::GenerateButton_pressed()
     command = "export HXX2SALOME_ROOT_DIR=";
     command += BINDIR;
     command += "; $HXX2SALOME_ROOT_DIR/hxx2salome ";
+    if (makeGUI->isChecked())
+        command += " \"-g\" ";
     if (Compile->isChecked())
         command += " \"-c\" ";
     if (shell == 1)