From 49546fa993e8de87ddebffd56f890aec71aa42d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 24 Sep 2009 22:43:58 +0000 Subject: [PATCH] Small script using hey to dump the BView hierarchy of a window of an app... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33280 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- 3rdparty/mmu_man/scripts/dumpwin.sh | 72 +++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 3rdparty/mmu_man/scripts/dumpwin.sh diff --git a/3rdparty/mmu_man/scripts/dumpwin.sh b/3rdparty/mmu_man/scripts/dumpwin.sh new file mode 100755 index 0000000000..a082e62743 --- /dev/null +++ b/3rdparty/mmu_man/scripts/dumpwin.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +unescape_url () { + echo -e "$(echo $*|sed 's/%/\\\x/g')" +} + + + + +dumpview () { + +# echo "$2= $1 of Window $WIN =" +# echo "${2}APP=$APP" +# echo "${2}WIN=$WIN" +#echo hey "$APP" count View of $1 Window $WIN + + local CNT="$(hey "$APP" count View of $1 Window $WIN | grep result | cut -d" " -f 7)" + + if [ -z "$CNT" ]; then +# echo "NULL" + return 0 + fi + +# echo "${2}CNT=$CNT=" + + if [ "$CNT" -lt 1 ]; then + return 0 + fi + + local C=0 + + while [ $C -lt $CNT ]; do + local INAME="$(hey "$APP" get InternalName of View $C of $1 Window $WIN | grep result | cut -d" " -f 7)" + echo "$2:: View $C/$CNT ($INAME) ( View $C of ${1}Window $WIN )" +# hey "$APP" get View $C of $1 Window $WIN | awk " { print \" $2\" \$0 } " +# hey "$APP" getsuites of View $C of $1 Window $WIN | grep Label >/dev/null + +# if hey "$APP" getsuites of View $C of $1 Window $WIN | grep Label >/dev/null; then +# echo hey "$APP" getsuites of View $C of $1 Window $WIN | grep Label +# hey "$APP" get Label of View $C of $1 Window $WIN | grep result | awk " { print \" $2\" \$0 } " +# fi + +# if hey "$APP" getsuites of View $C of $1 Window $WIN | grep Text >/dev/null; then +# echo hey "$APP" getsuites of View $C of $1 Window $WIN | grep Text +# hey "$APP" get Text of View $C of $1 Window $WIN | grep result | awk " { print \" $2\" \$0 } " +# fi + + if hey "$APP" getsuites of View $C of $1 Window $WIN | grep Value >/dev/null; then + echo hey "$APP" getsuites of View $C of $1 Window $WIN | grep Value + hey "$APP" get Value of View $C of $1 Window $WIN | grep result | awk " { print \" $2\" \$0 } " + fi + +#hey "$APP" getsuites of View $C of $1 Window $WIN | awk " { print \" $2\" \$0 } " + + dumpview "View $C of $1" " $2" + let C="$C + 1" + done + + echo "$2<" +} + +if [ "$#" -lt 2 ]; then +echo "$0 App Window" +exit 1 +fi + + +APP="$1" +WIN="$2" + +dumpview +