2 # Copyright (C) 2010-2024 CEA, EDF, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # ==================================================================
27 # dlgfactory.sh -n className [-t classType]
32 # This script generates a set of files to initiate a dialog qt window
33 # (i.e. MyDialog.ui, MyDialog.h and MyDialog.cxx files).
35 # The dialog window can be a self-consistent class (i.e. depends only
36 # on Qt classes) or a classe that inherits from the class
37 # GenericDialog whose implementation is provided in this package and
38 # whose design is defined by the GenericDialog.ui file (editable using
41 # The -t option let you choose between the two possibilities (specify
42 # "-t qdialog" for the first case, "-t gdialog" otherwise).
45 # -n : specify the name of the class (default is TestDialog)
47 # -t : specify the type of the class (default is qdialog)
50 # ==================================================================
53 thisScript=$(which $0)
54 TOOLDIRNAME=$(dirname $0)
58 cat $thisScript | sed -e '/^#_debut_usage/,/^#_fin_usage/!d' \
59 -e '/^#_debut_usage/d' \
60 -e '/^#_fin_usage/d' \
65 # Read the options on the command line
73 while [ $# -ne 0 ]; do
76 shift; className=$1; shift ;;
78 shift; classType=$1; shift ;;
85 if [ "$classType" = "qdialog" ]; then
86 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__QDIALOG__.ui > $className.ui
87 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__QDIALOG__.h > $className.h
88 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__QDIALOG__.cxx > $className.cxx
90 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__GDIALOG__.ui > $className.ui
91 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__GDIALOG__.h > $className.h
92 sed s/__CLASSNAME__/$className/g $TOOLDIRNAME/__GDIALOG__.cxx > $className.cxx
97 cat $thisScript | sed -e '/^#_debut_message/,/^#_fin_message/!d' \
98 -e '/^#_debut_message/d' \
99 -e '/^#_fin_message/d' \
101 -e "s/__CLASSNAME__/$className/g"
106 ## ---------------------------------------------------------
107 ## Generation rules to create moc files from QObject headers
108 ## and form source files from ui files
109 ## ---------------------------------------------------------
118 ## ---------------------------------------------------------
119 ## Declaration of form files generated by UIC and MOC files
120 ## as BUILT_SOURCES to be used in the building process.
121 ## ---------------------------------------------------------
127 # __CLASSNAME___moc.cxx
129 #BUILT_SOURCES = $(UIC_FILES)
132 ## ---------------------------------------------------------
133 ## Declaration of sources files to the building process
134 ## ---------------------------------------------------------
135 ## MOC files and UIC files should be added to the list of undistributed
136 ## source files with something like (where <MyLibrary> should be
137 ## replaced by the name of the product declared by the directive
140 #nodist_<MyLibrary>_la_SOURCES += $(MOC_FILES) $(UIC_FILES)
142 #dist_<MyLibrary>_la_SOURCES += __CLASSNAME__.cxx
143 #salomeinclude_HEADERS += __CLASSNAME__.h
145 #<MyLibrary>_la_CPPFLAGS = \
148 #<MyLibrary>_la_LDFLAGS = \
153 echo "Note that the following directives should be present in your CMakeLists.txt (or something like that):"