import gpm from unix.schottelius.org

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-10-08 22:52:35 +02:00
commit 95a46c5577
5930 changed files with 755263 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#! /bin/sh
#
# Script by Jakub Jelinek
# Modified by Ian Zimmerman <itz@rahul.net> to reflect names from
# kernel device list
# $Id: create_vcs,v 1.2 2002/05/28 19:13:52 nico Exp $
if test -e /dev/vcs0 || test -e /dev/vcs
then
exit
fi
I=0
while [ $I -lt 25 ]
do
mknod /dev/vcs$I c 7 $I
chmod 622 /dev/vcs$I
chown root.tty /dev/vcs$I
mknod /dev/vcsa$I c 7 `expr $I + 128`
chmod 622 /dev/vcsa$I
chown root.tty /dev/vcsa$I
I=`expr $I + 1`
done
ln -s vcs0 /dev/vcs
ln -s vcsa0 /dev/vcsa

View file

@ -0,0 +1,7 @@
cat $1 | sed 's/gpm_debug_log/gpm_report/g' > $1.tmp
cat $1.tmp | sed 's/LOG_NOTICE/GPM_PR_INFO/g' > $1.tmp2
cat $1.tmp2 | sed 's/LOG_ERR/GPM_PR_ERR/g' > $1.tmp
cat $1.tmp | sed 's/LOG_WARN/GPM_PR_WARN/g' > $1.tmp2
cat $1.tmp2 | sed 's/LOG_DEBUG/GPM_PR_DEBUG/g' > $1.tmp
echo "done:" $1.tmp

View file

@ -0,0 +1,37 @@
#!/bin/sh
#
# Date: 26th of September 2001
# Description: still missing
# Author: Nico Schottelius (nicos@pcsystems.de), 26th of September 2001
# Copying: GPL 2.0
#
if [ $# -ne 1 ]; then
echo `basename $0`': dir'
echo 'Hey, hey guy, what to release ?'
exit 1
fi
if [ ! -d $1 ]; then
echo `basename $0`': dir'
echo 'HEY! DIRECTORY! We need a gpm directory!'
exit 1
fi
version=`echo $1 | sed 's/\/$//' | sed 's/gpm-//'`
echo -n "Releasing gpm-$version ..."
cd $1
cat configure.in | sed "s/release=.\*/release=$version/" > configure.on
mv configure.on configure.in
autoconf
cat src/headers/gpmCfg.h | sed "s/\(#define GPM_DATE\).*/\1 \"`date`\"/" > src/headers/gpmCfg.i; mv src/headers/gpmCfg.i src/headers/gpmCfg.h
cd ..
tar cfz gpm-$version.tar.gz $1
tar cfI gpm-$version.tar.bz2 $1
echo done.

View file

@ -0,0 +1,315 @@
#!/bin/sh
#
# gunze-setup, copied and adapted from microtouch-setup.
# Most of this code is duplicated, this is definitely not good.
#
# This program is execute by tclsh if we are in the console, and by wish
# otherwise (assuming we are under a graphic environment
#the following is a comment for tcl \
if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi
#the following is another comment for tcl \
exec wish $0 $*
########### That's Tcl...
# The Gunze touchscreens don't adapt their output to calibration, so
# we must save calibration information somewhere...
set datafile /etc/gpm-calibration
puts "Calibration program for Gunze touch-screens"
# check generic permission
set who [exec whoami]
if [string compare $who root] {
puts stderr "you must be root to be able to run this program"
}
# check if we can access this file
if [catch {set F [open $datafile a]} err] {
puts stderr "$argv0: Can't open $datafile: $err"
exit 1
}
close $F
# Look for /dev/touchscreen or /dev/mouse
if [file exists /dev/mouse] {
set dev /dev/mouse
}
if [file exists /dev/touchscreen] {
set dev /dev/touchscreen
}
if ![info exists dev] {
puts stderr "$argv0: need to access /dev/touchscreen or /dev/mouse"
exit 1
}
# horrible, for the linux console
proc goto {x y} {
set x [expr $x]
set y [expr $y]
puts -nonewline [format "\x1B\[%03i;%03iH" $y $x]
}
# an abort procedure, and one to read touchscreen data
proc do_abort {msg} {
if ![string compare $env(TERM) linux] {
goto 0 $env(LINES)-2
} else {
wm withdraw .
}
puts stderr $msg
killall -CONT gpm
exit 1
}
proc get_position file {
global dev
while 1 {
gets $file string
if [scan $string %c%d,%d cmd x y]!=3 {
do_abort "Received wrong data \"$string\" from $dev"
}
# If release ('R') it's done
if $cmd==0x52 {
return "$sx $sy"
}
# If a touch event ('T'), save it
if $cmd==0x54 {
set sx $x; set sy $y
} else {
do_abort "Received wrong data \"$string\" from $dev"
}
}
}
if ![string compare $env(TERM) linux] {
# Text-mode calibration
if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} {
puts stderr "Please set COLUMNS and LINES in your environment"
puts stderr " for example, you can issue"
puts stderr " eval `resize`"
puts stderr " in your shell before running this program"
exit 1
}
fconfigure stdout -buffering none
exec clear > /dev/tty
# To calibrate, draw targets at 1/8 and 7/8 x-y
set x [expr $env(COLUMNS)/8]
set y [expr $env(LINES)/8]
set X [expr $env(COLUMNS) - $x]
set Y [expr $env(LINES) - $y]
# half x and y
set hx [expr $env(COLUMNS)/2]
set hy [expr $env(LINES)/2]
goto $hx-10 $hy-1; puts -nonewline "Please touch the lower"
goto $hx-10 $hy-0; puts -nonewline "left target, then the"
goto $hx-10 $hy+1; puts -nonewline "upper right target."
exec killall -STOP gpm
set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse
fconfigure $F -buffering none -translation auto
# Draw the target
goto $x $Y-1; puts -nonewline "|"
goto $x-1 $Y; puts -nonewline "-+-"
goto $x $Y+1; puts -nonewline "|"
# Read coordinates
set first [get_position $F]
#remove the target, draw the other
goto $x $Y-1; puts -nonewline " "
goto $x-1 $Y; puts -nonewline " "
goto $x $Y+1; puts -nonewline " "
goto $X $y-1; puts -nonewline "|"
goto $X-1 $y; puts -nonewline "-+-"
goto $X $y+1; puts -nonewline "|"
# Read coordinates
set second [get_position $F]
# remove the target
goto $X $y-1; puts -nonewline " "
goto $X-1 $y; puts -nonewline " "
goto $X $y+1; puts -nonewline " "
close $F
exec killall -CONT gpm
goto 0 $env(LINES)-2
# Now save the coordinates
set F [open $datafile w]
puts $F "# Calibration coordinates for Gunze device"
puts $F "$first $second"
close $F
puts "Done"
exit 0
}
# X calibration. This is Tk, so we can use the canvas items.
# However, there is uncertainty about the absolute X and Y...
set wid [winfo screenwidth .]
set hei [winfo screenheight .]
wm geometry . ${wid}x${hei}+0+0
set x [expr $wid/8]
set y [expr $hei/8]
set X [expr $wid - $x]
set Y [expr $hei - $y]
set hx [expr $wid/2]
set hy [expr $hei/2]
set cwid [expr 2*$x]
set chei [expr 2*$y]
# The offset variables account for window manager borders etc
set xoff1 0
set yoff1 0
set xoff2 0
set yoff2 0
proc recanvas {} {
global x y X Y xoff1 xoff2 yoff1 yoff2
catch {.l.c delete line}
catch {.r.c delete line}
set x1 [expr $x-$xoff1]
set y1 [expr $Y-$yoff1]
set x2 [expr $X-$xoff2]
set y2 [expr $y-$yoff2]
.l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \
-width 3 -fill red -tag line
.l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \
-width 3 -fill red -tag line
.r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \
-width 3 -fill red -tag line
.r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \
-width 3 -fill red -tag line
}
pack [frame .l] -side left -expand true -fill both
pack [frame .m] -side left -expand true -fill both
pack [frame .r] -side left -expand true -fill both
pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \
] -side bottom
pack [frame .l.f] -expand true -fill both; #filler
pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \
] -side top
pack [frame .r.f] -expand true -fill both; #filler
pack [label .m.t -text "Gunze Calibrator" -foreground blue] -pady 40
pack [label .m.l -bd 5 -relief raised] -expand true -fill both
pack [label .m.s] -expand true -fill both
bind .l.c <Enter> {
set xoff1 [expr %X - %x]
set yoff1 [expr %Y - %y]
set x1 [expr $x-$xoff1]
set y1 [expr $Y-$yoff1]
catch {.l.c delete line}
.l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \
-width 3 -fill red -tag line
.l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \
-width 3 -fill red -tag line
set done1 1
update
}
bind .r.c <Enter> {
set xoff2 [expr %X - %x]
set yoff2 [expr %Y - %y]
set x2 [expr $X-$xoff2]
set y2 [expr $y-$yoff2]
catch {.r.c delete line}
.r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \
-width 3 -fill red -tag line
.r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \
-width 3 -fill red -tag line
set done2 1
update
}
set done1 0; set done2 0
update
.m.l config -text "Please move the mouse towards\n\
the lower left corner, until a cross\n\
appears (there's no need to click)"
vwait done1
update
if !$done2 {
.m.l config -text "Please move the mouse towards\n\
the upper right corner, until a cross\n\
appears (there's no need to click)"
vwait done2
}
.m.l config -text "\nWait....\n"
after 1000
.m.l config -text "Please touch the lower-left taget\n\
and then the upper-right target\n\
to calibrate the touch screen"
update
exec killall -STOP gpm
set F [open $dev r+]; # $dev is /dev/touchscreen or /dev/mouse
fconfigure $F -buffering none -translation auto
.m.s configure -text "Calibration started"
update
# Read coordinates
set first [get_position $F]
.l.c itemco line -fill green
.m.s configure -text "First target ok"
update
# Read coordinates
set second [get_position $F]
.r.c itemco line -fill green
.m.s configure -text "Second target ok"
update
close $F
exec killall -CONT gpm
# Now save the coordinates
set F [open $datafile w]
puts $F "# Calibration coordinates for Gunze device"
puts $F "$first $second"
close $F
after 1000
.m.s configure -text ""
pack [button .m.b -text Ok -command exit]
exit 0

View file

@ -0,0 +1,8 @@
#!/bin/sh
# Date: 3rd of October 2001
# Description: still missing
# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001
# Copying: GPL 2.0
#
diff -u --recursive --new-file $@

View file

@ -0,0 +1,239 @@
#!/bin/sh
#
# This program is execute by tclsh if we are in the console, and by wish
# otherwise (assuming we are under a graphic environment
#the following is a comment for tcl \
if [ $TERM = "linux" ] ; then exec tclsh $0 $* ; fi
#the following is another comment for tcl \
exec wish $0 $*
########### That's Tcl...
puts "Calibration program for Microtouch screens"
set who [exec whoami]
if [string compare $who root] {
puts stderr "you must be root to be able to run this program"
}
if ![string compare $env(TERM) linux] {
# Text-mode calibration
if {![info exists env(COLUMNS)] || ![info exists env(LINES)]} {
puts stderr "Please set COLUMNS and LINES in your environment"
puts stderr " for example, you can issue"
puts stderr " eval `resize`"
puts stderr " in your shell before running this program"
exit 1
}
fconfigure stdout -buffering none
exec clear > /dev/tty
proc goto {x y} {
set x [expr $x]
set y [expr $y]
puts -nonewline [format "\x1B\[%03i;%03iH" $y $x]
}
# To use "calibrate extended we must draw targets at 1/8 and 7/8 x-y
set x [expr $env(COLUMNS)/8]
set y [expr $env(LINES)/8]
set X [expr $env(COLUMNS) - $x]
set Y [expr $env(LINES) - $y]
# half x and y
set hx [expr $env(COLUMNS)/2]
set hy [expr $env(LINES)/2]
goto $hx-10 $hy-1; puts -nonewline "Please touch the lower"
goto $hx-10 $hy-0; puts -nonewline "left target, then the"
goto $hx-10 $hy+1; puts -nonewline "upper right target."
exec killall -STOP gpm
set F [open /dev/mouse r+]
fconfigure $F -buffering none
puts $F "\1CX\r"
set ack [gets $F]; # Acknowledge
goto $hx-18 $hy+3; puts -nonewline "received acknowledge: please start"
goto $x $Y-1; puts -nonewline "|"
goto $x-1 $Y; puts -nonewline "-+-"
goto $x $Y+1; puts -nonewline "|"
set ack [gets $F]; # First calibration point
goto $hx-5 $hy+4; puts -nonewline "received acknowledge: please go on"
#remove the target, draw the other
goto $x $Y-1; puts -nonewline " "
goto $x-1 $Y; puts -nonewline " "
goto $x $Y+1; puts -nonewline " "
goto $X $y-1; puts -nonewline "|"
goto $X-1 $y; puts -nonewline "-+-"
goto $X $y+1; puts -nonewline "|"
set ack [gets $F]; # Next calibration point
goto $hx-5 $hy+5; puts -nonewline "received acknowledge: looks ok"
goto $X $y-1; puts -nonewline " "
goto $X-1 $y; puts -nonewline " "
goto $X $y+1; puts -nonewline " "
close $F
exec killall -CONT gpm
goto 0 $env(LINES)-2
puts "Done"
exit 0
}
# X calibration. This is Tk, so we can use the canvas items.
# However, there is uncertainty about the absolute X and Y...
set wid [winfo screenwidth .]
set hei [winfo screenheight .]
wm geometry . ${wid}x${hei}+0+0
set x [expr $wid/8]
set y [expr $hei/8]
set X [expr $wid - $x]
set Y [expr $hei - $y]
set hx [expr $wid/2]
set hy [expr $hei/2]
set cwid [expr 2*$x]
set chei [expr 2*$y]
# The offset variables account for window manager borders etc
set xoff1 0
set yoff1 0
set xoff2 0
set yoff2 0
proc recanvas {} {
global x y X Y xoff1 xoff2 yoff1 yoff2
catch {.l.c delete line}
catch {.r.c delete line}
set x1 [expr $x-$xoff1]
set y1 [expr $Y-$yoff1]
set x2 [expr $X-$xoff2]
set y2 [expr $y-$yoff2]
.l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \
-width 3 -fill red -tag line
.l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \
-width 3 -fill red -tag line
.r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \
-width 3 -fill red -tag line
.r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \
-width 3 -fill red -tag line
}
pack [frame .l] -side left -expand true -fill both
pack [frame .m] -side left -expand true -fill both
pack [frame .r] -side left -expand true -fill both
pack [canvas .l.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \
] -side bottom
pack [frame .l.f] -expand true -fill both; #filler
pack [canvas .r.c -width $cwid -hei $chei -scrollregion "0 0 $cwid $chei" \
] -side top
pack [frame .r.f] -expand true -fill both; #filler
pack [label .m.t -text "MicroTouch Calibrator" -foreground blue] -pady 40
pack [label .m.l -bd 5 -relief raised] -expand true -fill both
pack [label .m.s] -expand true -fill both
bind .l.c <Enter> {
set xoff1 [expr %X - %x]
set yoff1 [expr %Y - %y]
set x1 [expr $x-$xoff1]
set y1 [expr $Y-$yoff1]
catch {.l.c delete line}
.l.c create line [expr $x1-50] $y1 [expr $x1+50] $y1 \
-width 3 -fill red -tag line
.l.c create line $x1 [expr $y1-50] $x1 [expr $y1+50] \
-width 3 -fill red -tag line
set done1 1
update
}
bind .r.c <Enter> {
set xoff2 [expr %X - %x]
set yoff2 [expr %Y - %y]
set x2 [expr $X-$xoff2]
set y2 [expr $y-$yoff2]
catch {.r.c delete line}
.r.c create line [expr $x2-50] $y2 [expr $x2+50] $y2 \
-width 3 -fill red -tag line
.r.c create line $x2 [expr $y2-50] $x2 [expr $y2+50] \
-width 3 -fill red -tag line
set done2 1
update
}
set done1 0; set done2 0
update
.m.l config -text "Please move the mouse towards\n\
the lower left corner, until a cross\n\
appears (there's no need to click)"
vwait done1
update
if !$done2 {
.m.l config -text "Please move the mouse towards\n\
the upper right corner, until a cross\n\
appears (there's no need to click)"
vwait done2
}
.m.l config -text "\nWait....\n"
after 1000
.m.l config -text "Please touch the lower-left taget\n\
and then the upper-right target\n\
to calibrate the touch screen"
update
exec killall -STOP gpm
set F [open /dev/mouse r+]
fconfigure $F -buffering none
puts $F "\1CX\r"
set ack [gets $F]; # Acknowledge
.m.s configure -text "Calibration started"
update
set ack [gets $F]; # First calibration point
.l.c itemco line -fill green
.m.s configure -text "First target ok"
update
set ack [gets $F]; # Next calibration point
.r.c itemco line -fill green
.m.s configure -text "Second target ok"
update
close $F
exec killall -CONT gpm
after 1000
.m.s configure -text ""
pack [button .m.b -text Ok -command exit]
exit 0

View file

@ -0,0 +1,40 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
# $Id: mkinstalldirs,v 1.2 2002/05/28 19:13:52 nico Exp $
errstatus=0
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here

View file

@ -0,0 +1,9 @@
# 8 -> 2*4 --> 4*3 = 12
cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp
# 6=3*2 --> 3*3=9
cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2
# 4=2*2 --> 2*3=6
cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp
# 2=1*2 --> 1*3=3
cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2
echo done: $1.tmp2

View file

@ -0,0 +1,10 @@
# 4 tabs
cat $1 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp
# 3 tabs
cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2
# 2 tabs
cat $1.tmp2 | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp
# 1 tab
cat $1.tmp | sed 's/^ \([^ ]\)/ \1/g' > $1.tmp2
rm $1.tmp
echo done: $1.tmp2

View file

@ -0,0 +1,35 @@
#!/bin/sh
#
# Date: 18th of September 2001
# Description: Test gpm with this script :)
# Author: Nico Schottelius (nicos@pcsystems.de), 3rd of October 2001
# Copying: GPL 2.0
# Version: 0.2
#
PREFIX=test-
POSTFIX=
if [ $# -ne 1 ]; then
echo `basename $0`': dir'
echo 'Hey, hey guy, what to test ?'
exit 1
fi
if [ ! -d $1 ]; then
echo `basename $0`': dir'
echo 'HEY! I need a DIRECTORY! Not something else!'
exit 1
fi
echo rm -rf $PREFIX`basename $1`$POSTFIX -r
rm -rf $PREFIX`basename $1`$POSTFIX -r
echo cp $1 $PREFIX`basename $1`$POSTFIX -r
cp $1 $PREFIX`basename $1`$POSTFIX -r
echo rm -rf mkdir objdir
rm -rf objdir/ && mkdir -p objdir && cd objdir
echo configure
../$PREFIX`basename $1`$POSTFIX/configure --prefix=/usr/sys
echo make
make