From b073219efd74788b5f0e7b9e8efd31bbe3b11881 Mon Sep 17 00:00:00 2001 From: dcp1990 Date: Sun, 26 Jun 2005 16:51:00 +0000 Subject: [PATCH] Stuff added --- xfone/config.tcl | 33 +++++++++++++++++++++++++++++++++ xfone/init.tcl | 31 +++++++++++++++++++++++++++++++ xfone/maindlg.tcl | 17 ++++++++++++++++- xfone/phoned.tcl | 24 +++++++++++++++++++----- xfone/xfone.tcl | 5 ++++- 5 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 xfone/config.tcl create mode 100644 xfone/init.tcl diff --git a/xfone/config.tcl b/xfone/config.tcl new file mode 100644 index 0000000..c36505c --- /dev/null +++ b/xfone/config.tcl @@ -0,0 +1,33 @@ +#!/usr/local/bin/wish8.4 +# Copyright (c) 2005, Dan Ponte +# +# config.tcl - configureation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $Amigan: phoned/xfone/config.tcl,v 1.1 2005/06/26 16:51:00 dcp1990 Exp $ + +#defaults +set sockfile "/tmp/phoned.sock" diff --git a/xfone/init.tcl b/xfone/init.tcl new file mode 100644 index 0000000..4e66bdb --- /dev/null +++ b/xfone/init.tcl @@ -0,0 +1,31 @@ +#!/usr/local/bin/wish8.4 +# Copyright (c) 2005, Dan Ponte +# +# init.tcl - initialisation +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 4. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $Amigan: phoned/xfone/init.tcl,v 1.1 2005/06/26 16:51:00 dcp1990 Exp $ +logindlg diff --git a/xfone/maindlg.tcl b/xfone/maindlg.tcl index 64b7ac6..f62658e 100644 --- a/xfone/maindlg.tcl +++ b/xfone/maindlg.tcl @@ -27,8 +27,23 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Amigan: phoned/xfone/maindlg.tcl,v 1.1 2005/06/26 04:47:20 dcp1990 Exp $ +# $Amigan: phoned/xfone/maindlg.tcl,v 1.2 2005/06/26 16:51:00 dcp1990 Exp $ # vars +proc logindlg {} { + toplevel .login + frame .login.m -width 5c -height 2c + grid .m -row 0 -column 0 + label .login.m.lo -text "Login:" + entry .login.m.loge + grid .login.m.lo .login.m.loge -row 0 + label .login.m.pa -text "Pass:" + entry .login.m.pase -show "*" + grid .login.m.pa .login.m.pase -row 1 + button .login.m.log -text "Login" -command {loginProc [.login.m.loge get] [.login.m.pase get]} + button .login.m.cancel -text "Cancel" -command {destroy .login} + grid .login.m.log -row 0 -column 0 -sticky ew + grid .login.m.cancel -row 0 -column 1 -sticky ew +} set prj .mbar.project set phdm .mbar.phoned #frame diff --git a/xfone/phoned.tcl b/xfone/phoned.tcl index 96aa094..491810b 100644 --- a/xfone/phoned.tcl +++ b/xfone/phoned.tcl @@ -1,7 +1,7 @@ #!/usr/local/bin/wish8.4 # Copyright (c) 2005, Dan Ponte # -# xfone.tcl - interface to phoned - main script +# phoned.tcl - Tcl interface to phoned's socket using my udom package # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -27,8 +27,22 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Amigan: phoned/xfone/phoned.tcl,v 1.3 2005/06/26 16:08:19 dcp1990 Exp $ +# $Amigan: phoned/xfone/phoned.tcl,v 1.4 2005/06/26 16:51:00 dcp1990 Exp $ load ./udom.so -set sockfile "/tmp/phoned.sock" -set fph [udom -file $sockfile] -close $fph + +proc openSock {sfile} { + set os [udom -file $sfile] + fconfigure $os -buffering line + return $os +} + +proc parseres {res} { +} + +proc login {user pass} { + global sh + puts $sh {login $user $pass} + parseres [gets $sh] +} + +set $sh [openSock $sockfile] diff --git a/xfone/xfone.tcl b/xfone/xfone.tcl index a20617f..85b44d5 100755 --- a/xfone/xfone.tcl +++ b/xfone/xfone.tcl @@ -27,5 +27,8 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Amigan: phoned/xfone/xfone.tcl,v 1.1 2005/06/26 04:47:20 dcp1990 Exp $ +# $Amigan: phoned/xfone/xfone.tcl,v 1.2 2005/06/26 16:51:00 dcp1990 Exp $ +source config.tcl +source phoned.tcl source maindlg.tcl +source init.tcl