diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /qtjava/designer/juic/bin | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtjava/designer/juic/bin')
-rwxr-xr-x | qtjava/designer/juic/bin/juic | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/qtjava/designer/juic/bin/juic b/qtjava/designer/juic/bin/juic new file mode 100755 index 00000000..8104ac9b --- /dev/null +++ b/qtjava/designer/juic/bin/juic @@ -0,0 +1,93 @@ +#!/bin/sh +# +# Author: Marco Ladermann +# Date: Sat May 10 13:59:35 CEST 2003 @541 /Internet Time/ +# Purpose: Starts the transformation process of a UI file to Java +# Changed: +# +# This software is free software. It is released under the terms of the +# GNU Lesser General Public Licence (LGPL) +# see http://www.gnu.org/copyleft/lesser.html +# +# These stylesheets are distributed in the hope that they will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# + +getAbsolutePath() { + ls=$(ls -l $1) + pushd `dirname ${ls##* }` >/dev/null + pwd -P + popd >/dev/null +} + +usage() { + juic=$(basename $0) + cat <<EOT +Usage: $juic [options] uifile... +Where options can be: + -outdir "dir" : output directory, defaults to current directory + -package "the.package.for.the.class" : Generates a package declaration + -main (true | false) : Generate a main method, defaults to "false" + -abstract (true | false) : Slots are declared abstract, defaults to "true" + -images dir : Path to images, defaults to "images" + -os (unix | msdos | mac) : Selects newline characters +EOT + exit 1 +} + +# Assume the directory structure +# ${UIXSL}/ +# bin/ +# xsl/ +# common/ +# java + +a=$(getAbsolutePath $0) +UIXSLDIR=$(dirname "$a") +UIXSL=${UIXSLDIR}/juic.xsl + +ABSTRACT="true" +MAIN="false" +OUTDIR="." +IMAGES="images" +OS="unix" +PACKAGE="" + +while [ -n "$1" ] +do + case "$1" in + -abstract) ABSTRACT=$2; shift; shift;; + -main) MAIN=$2; shift; shift;; + -outdir) OUTDIR=$2; shift; shift;; + -images) IMAGES=$2; shift; shift;; + -os) OS=$2; shift; shift;; + -package) PACKAGE=$2; shift; shift;; + -*) echo Unknown parameter $1; shift;; + *) break;; + esac +done + +if [ -z "$1" ] +then + usage +fi +if [ $ABSTRACT = 'true' -a $MAIN = 'true' ] +then + echo "Option \"-main\" will be ignored, because class will be abstract" + MAIN="false" +fi + +while [ -n "$1" ] +do + xsltproc --nonet --novalid \ + --stringparam package "$PACKAGE" \ + --stringparam outdir "$OUTDIR/" \ + --stringparam images "$IMAGES/" \ + --stringparam os $OS \ + --stringparam genabstract $ABSTRACT \ + --stringparam genmain $MAIN \ + $UIXSL "$1" + shift +done + |