From: Jon Trulson Date: Fri, 20 Jul 2018 02:39:58 +0000 (-0600) Subject: Rename "dtapp" to "dtopen" X-Git-Tag: 2.3.0a~26^2~30 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d557db4eb27ae795e95c64606dc829c143c85e30;p=oweals%2Fcde.git Rename "dtapp" to "dtopen" A great suggestion by Matthew Trower. --- diff --git a/cde/.gitignore b/cde/.gitignore index 0869c789..9d102689 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -145,7 +145,7 @@ config/util/xmkmf examples/tt/broadcast # Compiled binaries and misc generated program files -programs/dtapp/dtapp +programs/dtopen/dtopen programs/dsdm/dsdm programs/dtaction/dtaction programs/dtappintegrate/dtappintegrate diff --git a/cde/databases/CDE-RUN.udb b/cde/databases/CDE-RUN.udb index 3f9471d2..39ea2bff 100644 --- a/cde/databases/CDE-RUN.udb +++ b/cde/databases/CDE-RUN.udb @@ -2613,34 +2613,34 @@ programs/localized/ja_JP.dt-eucJP/dtsr/jpn.knj # #>>----------------------------- # -# dtapp entries +# dtopen entries # #<<----------------------------- # # -programs/dtapp/dtapp +programs/dtopen/dtopen { default - install_target = /usr/dt/bin/dtapp + install_target = /usr/dt/bin/dtopen mode = 0555 } -# Now the dtapp symlinks -./dtapp +# Now the dtopen symlinks +./dtopen { default - install_target = /usr/dt/bin/dtapp_vimage + install_target = /usr/dt/bin/dtopen_image type = sym_link } -./dtapp +./dtopen { default - install_target = /usr/dt/bin/dtapp_vpdf + install_target = /usr/dt/bin/dtopen_pdf type = sym_link } -./dtapp +./dtopen { default - install_target = /usr/dt/bin/dtapp_vps + install_target = /usr/dt/bin/dtopen_ps type = sym_link } -./dtapp +./dtopen { default - install_target = /usr/dt/bin/dtapp_vvideo + install_target = /usr/dt/bin/dtopen_video type = sym_link } diff --git a/cde/programs/Imakefile b/cde/programs/Imakefile index f0506c97..fd6abf08 100644 --- a/cde/programs/Imakefile +++ b/cde/programs/Imakefile @@ -5,7 +5,7 @@ XCOMM $XConsortium: Imakefile /main/17 1996/10/06 17:13:20 rws $ #if UseNSGMLS NSGMLSDIR = nsgmls #endif -EXTRADIRS = types localized tttypes $(NSGMLSDIR) util dtapp +EXTRADIRS = types localized tttypes $(NSGMLSDIR) util dtopen XCOMM some of these cannot be built on linux yet. XCOMM dtinfo diff --git a/cde/programs/dtapp/Imakefile b/cde/programs/dtapp/Imakefile deleted file mode 100644 index 571b9dbf..00000000 --- a/cde/programs/dtapp/Imakefile +++ /dev/null @@ -1,13 +0,0 @@ -XCOMM make dtapp fro dtapp.src -#define PassCDebugFlags - -AllTarget(dtapp) - -LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ - -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ - -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) - -CppScriptTarget(dtapp,dtapp.src,$(LOCAL_CPP_DEFINES),) - -depend:: - diff --git a/cde/programs/dtapp/dtapp.src b/cde/programs/dtapp/dtapp.src deleted file mode 100755 index 7b1cec18..00000000 --- a/cde/programs/dtapp/dtapp.src +++ /dev/null @@ -1,141 +0,0 @@ -XCOMM!/bin/ksh -XCOMM -XCOMM dtapp - provide an interface for some useful applications. -XCOMM -XCOMM ############################################################# -XCOMM #set -x # uncomment for debugging -XCOMM ############################################################### -XCOMM Init - -DTAPP="dtapp" # Identity crisis -APPNAME="$(basename $0)" # the app to locate/run - -XCOMM apps to look for, given an action (based on APPNAME - see MAIN) - -XCOMM image viewing -if [ -z "$DTAPP_VIMAGE" ] -then - VIMAGE="xv display gimp" -else - VIMAGE="$DTAPP_VIMAGE" -fi - -XCOMM video viewing -if [ -z "$DTAPP_VVIDEO" ] -then - VVIDEO="vlc ffplay" -else - VVIDEO="$DTAPP_VVIDEO" -fi - -XCOMM postscript viewing -if [ -z "$DTAPP_VPS" ] -then - VPS="mgv gv" -else - VPS="$DTAPP_VPS" -fi - -XCOMM PDF viewing -if [ -z "$DTAPP_VPDF" ] -then - VPDF="okular xpdf" -else - VPDF="$DTAPP_VPDF" -fi - -XCOMM ############################################################## -XCOMM ## Utility Functions - -XCOMM ## Find the path of a program -FindProg() -{ - # FindProg "program" - # - returns full path, or "" - - whence $1 - - return 0 -} - -XCOMM ## Show an error message -ErrorMsg() -{ - # ErrorMsg "Title "Message" ["OK"] - # use dterror.ds to display it... - - if [ -z "$3" ] - then # default to 'OK' - OKM="OK" - else - OKM="$3" - fi - - CDE_INSTALLATION_TOP/bin/dterror.ds "$2" "$1" "$OKM" - - return 0 -} - -XCOMM ## do a simple command -DoSimpleCmd() -{ - # DoSimpleCmd "commands" args - - didone=0 - cmds="$1" - shift - args="$*" - - for i in $cmds - do - thecmd="$(FindProg $i)" - - if [ ! -z "$thecmd" ] - then # it's there - $thecmd "$args" - didone=1 - break - fi - done - - if [ $didone -eq 0 ] - then # couldn't find a viewer - ErrorMsg "Helper not found" \ - "${DTAPP}: Could not find any of the following\ncommands for this file type:\n\n$cmds" - fi - - return 0 -} - - -XCOMM ################################################################## -XCOMM ## MAIN - -XCOMM # We'll just look at our args and decide what to do... - -XCOMM # Commands we'll recognize - -COMMANDS="dtapp_vimage dtapp_vweb dtapp_vpdf dtapp_vps dtapp_vvideo" - -case $APPNAME in - dtapp_vimage) - DoSimpleCmd "$VIMAGE" $* - ;; - dtapp_vpdf) - DoSimpleCmd "$VPDF" $* - ;; - dtapp_vps) - DoSimpleCmd "$VPS" $* - ;; - dtapp_vvideo) - DoSimpleCmd "$VVIDEO" $* - ;; - *) - # Unknown - ErrorMsg "${DTAPP}: Unknown Helper Application" \ - "\"$APPNAME\" is not a recognized Helper Application. \nKnown Helper Applications are:\n\n$COMMANDS" - ;; -esac - -XCOMM # Fini -exit 0 diff --git a/cde/programs/dtopen/Imakefile b/cde/programs/dtopen/Imakefile new file mode 100644 index 00000000..2347d75d --- /dev/null +++ b/cde/programs/dtopen/Imakefile @@ -0,0 +1,13 @@ +XCOMM make dtopen fro dtopen.src +#define PassCDebugFlags + +AllTarget(dtopen) + +LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ + -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \ + -DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) + +CppScriptTarget(dtopen,dtopen.src,$(LOCAL_CPP_DEFINES),) + +depend:: + diff --git a/cde/programs/dtopen/dtopen.src b/cde/programs/dtopen/dtopen.src new file mode 100755 index 00000000..ff7476fb --- /dev/null +++ b/cde/programs/dtopen/dtopen.src @@ -0,0 +1,141 @@ +XCOMM!/bin/ksh +XCOMM +XCOMM dtopen - provide an interface for some useful applications. +XCOMM +XCOMM ############################################################# +XCOMM #set -x # uncomment for debugging +XCOMM ############################################################### +XCOMM Init + +DTOPEN="dtopen" # Identity crisis +APPNAME="$(basename $0)" # the app to locate/run + +XCOMM apps to look for, given an action (based on APPNAME - see MAIN) + +XCOMM image viewing +if [ -z "$DTOPEN_VIMAGE" ] +then + VIMAGE="xv display gimp" +else + VIMAGE="$DTOPEN_VIMAGE" +fi + +XCOMM video viewing +if [ -z "$DTOPEN_VVIDEO" ] +then + VVIDEO="vlc ffplay" +else + VVIDEO="$DTOPEN_VVIDEO" +fi + +XCOMM postscript viewing +if [ -z "$DTOPEN_VPS" ] +then + VPS="mgv gv" +else + VPS="$DTOPEN_VPS" +fi + +XCOMM PDF viewing +if [ -z "$DTOPEN_VPDF" ] +then + VPDF="okular xpdf" +else + VPDF="$DTOPEN_VPDF" +fi + +XCOMM ############################################################## +XCOMM ## Utility Functions + +XCOMM ## Find the path of a program +FindProg() +{ + # FindProg "program" + # - returns full path, or "" + + whence $1 + + return 0 +} + +XCOMM ## Show an error message +ErrorMsg() +{ + # ErrorMsg "Title "Message" ["OK"] + # use dterror.ds to display it... + + if [ -z "$3" ] + then # default to 'OK' + OKM="OK" + else + OKM="$3" + fi + + CDE_INSTALLATION_TOP/bin/dterror.ds "$2" "$1" "$OKM" + + return 0 +} + +XCOMM ## do a simple command +DoSimpleCmd() +{ + # DoSimpleCmd "commands" args + + didone=0 + cmds="$1" + shift + args="$*" + + for i in $cmds + do + thecmd="$(FindProg $i)" + + if [ ! -z "$thecmd" ] + then # it's there + $thecmd "$args" + didone=1 + break + fi + done + + if [ $didone -eq 0 ] + then # couldn't find a viewer + ErrorMsg "Helper not found" \ + "${DTOPEN}: Could not find any of the following\ncommands for this file type:\n\n$cmds" + fi + + return 0 +} + + +XCOMM ################################################################## +XCOMM ## MAIN + +XCOMM # We'll just look at our args and decide what to do... + +XCOMM # Commands we'll recognize + +COMMANDS="dtopen_image dtopen_pdf dtopen_ps dtopen_video" + +case $APPNAME in + dtopen_image) + DoSimpleCmd "$VIMAGE" $* + ;; + dtopen_pdf) + DoSimpleCmd "$VPDF" $* + ;; + dtopen_ps) + DoSimpleCmd "$VPS" $* + ;; + dtopen_video) + DoSimpleCmd "$VVIDEO" $* + ;; + *) + # Unknown + ErrorMsg "${DTOPEN}: Unknown Helper Application" \ + "\"$APPNAME\" is not a recognized Helper Application. \nKnown Helper Applications are:\n\n$COMMANDS" + ;; +esac + +XCOMM # Fini +exit 0 diff --git a/cde/programs/types/DisplayImage.dt b/cde/programs/types/DisplayImage.dt index b27a8d11..adb847f7 100644 --- a/cde/programs/types/DisplayImage.dt +++ b/cde/programs/types/DisplayImage.dt @@ -11,7 +11,7 @@ ACTION DisplayImage ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT 0 - EXEC_STRING dtapp_vimage %(File)"Name of image file to display:"% + EXEC_STRING dtopen_image %(File)"Name of image file to display:"% WINDOW_TYPE NO_STDIO DESCRIPTION Display image } @@ -24,7 +24,7 @@ ACTION DisplayImage ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT >0 - EXEC_STRING dtapp_vimage %(File)Args% + EXEC_STRING dtopen_image %(File)Args% WINDOW_TYPE NO_STDIO DESCRIPTION Edit image file. } diff --git a/cde/programs/types/DisplayPDF.dt b/cde/programs/types/DisplayPDF.dt index 110ecf9f..abde59b6 100644 --- a/cde/programs/types/DisplayPDF.dt +++ b/cde/programs/types/DisplayPDF.dt @@ -11,7 +11,7 @@ ACTION DisplayPDF ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT 0 - EXEC_STRING dtapp_vpdf %(File)"Name of PDF file to display:"% + EXEC_STRING dtopen_pdf %(File)"Name of PDF file to display:"% WINDOW_TYPE NO_STDIO DESCRIPTION Display image } @@ -24,7 +24,7 @@ ACTION DisplayPDF ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT >0 - EXEC_STRING dtapp_vpdf %(File)Args% + EXEC_STRING dtopen_pdf %(File)Args% WINDOW_TYPE NO_STDIO DESCRIPTION Edit image file. } diff --git a/cde/programs/types/DisplayPS.dt b/cde/programs/types/DisplayPS.dt index 9bc825ad..d5a7b321 100644 --- a/cde/programs/types/DisplayPS.dt +++ b/cde/programs/types/DisplayPS.dt @@ -11,7 +11,7 @@ ACTION DisplayPS ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT 0 - EXEC_STRING dtapp_vps %(File)"Name of PS file to display:"% + EXEC_STRING dtopen_ps %(File)"Name of PS file to display:"% WINDOW_TYPE NO_STDIO DESCRIPTION Display image } @@ -24,7 +24,7 @@ ACTION DisplayPS ICON camera EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT >0 - EXEC_STRING dtapp_vps %(File)Args% + EXEC_STRING dtopen_ps %(File)Args% WINDOW_TYPE NO_STDIO DESCRIPTION Edit image file. } diff --git a/cde/programs/types/DisplayVideo.dt b/cde/programs/types/DisplayVideo.dt index 9ce561da..7faafeea 100644 --- a/cde/programs/types/DisplayVideo.dt +++ b/cde/programs/types/DisplayVideo.dt @@ -11,7 +11,7 @@ ACTION DisplayVideo ICON video EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT 0 - EXEC_STRING dtapp_vvideo %(File)"Name of video file to display:"% + EXEC_STRING dtopen_video %(File)"Name of video file to display:"% WINDOW_TYPE NO_STDIO DESCRIPTION Play video file } @@ -24,7 +24,7 @@ ACTION DisplayVideo ICON video EXEC_HOST %DatabaseHost%, %LocalHost% ARG_COUNT >0 - EXEC_STRING dtapp_vvideo %(File)Args% + EXEC_STRING dtopen_video %(File)Args% WINDOW_TYPE NO_STDIO DESCRIPTION Play video file. }