From 1cd0aea41e22cd33aad4f30d2e844657bd2ac2bc Mon Sep 17 00:00:00 2001 From: Andy Bennett Date: Fri, 11 Aug 2023 16:22:03 +0100 Subject: [PATCH 1/4] Fix build errors on Debian 10 with tcl 8.6 and Tk 8.6 + ; rather than , in shapeSetUpdateOps() argument list. + Redefinition of panic is not required as it is supplied by the tcl 8.6 headers. + Include shapeInt.h rather than shape.h in shapeUnixImpl.c to get definition of ShapeApplyToParent. + Make ordering of Shape_CombineWindow() arguments consistent with the prototype and the documentation. Signed-off-by: Andy Bennett --- generic/shape.c | 2 +- include/panic.h | 2 +- unix/shapeUnixImpl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/shape.c b/generic/shape.c index 845c3d8..2ada898 100644 --- a/generic/shape.c +++ b/generic/shape.c @@ -428,7 +428,7 @@ shapePhoto( static int shapeSetUpdateOps( Tk_Window tkwin0, - Tcl_Interp *interp; + Tcl_Interp *interp, int opnum, int objc, Tcl_Obj *const objv[]) diff --git a/include/panic.h b/include/panic.h index 02385b2..4eaf365 100644 --- a/include/panic.h +++ b/include/panic.h @@ -2,7 +2,7 @@ #define PANIC_H #ifdef __GNUC__ -EXTERN void panic(char *message, ...) __attribute__((__noreturn__ , __format__(printf,1,2))); +/* EXTERN void panic(char *message, ...) __attribute__((__noreturn__ , __format__(printf,1,2))); */ #else EXTERN void panic(char *message, ...); #endif diff --git a/unix/shapeUnixImpl.c b/unix/shapeUnixImpl.c index 6cfd2f0..5f86839 100644 --- a/unix/shapeUnixImpl.c +++ b/unix/shapeUnixImpl.c @@ -13,7 +13,7 @@ #include /* Includes conventional X stuff. */ #include /* For Region declaration. */ #include -#include "shape.h" +#include "shapeInt.h" #ifdef DKF_SHAPE_DEBUGGING static int @@ -364,11 +364,11 @@ int Shape_CombineWindow( Tcl_Interp *interp, Tk_Window tkwin, - Tk_Window srcwin, int kind, int op, int x, - int y) + int y, + Tk_Window srcwin) { Display *dpy = Tk_Display(tkwin); Display *sdpy = Tk_Display(srcwin); From ff83ff9e454ec39ef2511a4bef04596d921443bc Mon Sep 17 00:00:00 2001 From: Andy Bennett Date: Fri, 11 Aug 2023 16:24:18 +0100 Subject: [PATCH 2/4] Fix reference to `wish` executable in demo scripts I have `wish` and `wish8.6` executables. 8.X is available almost everywhere these days so assume that `wish` gives us an 8.X `wish` so that we don't have to change this again for every minor version. Signed-off-by: Andy Bennett --- demos/dragger.tcl | 2 +- demos/fancytext.tcl | 2 +- demos/fingerprint.tcl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 demos/dragger.tcl mode change 100644 => 100755 demos/fancytext.tcl mode change 100644 => 100755 demos/fingerprint.tcl diff --git a/demos/dragger.tcl b/demos/dragger.tcl old mode 100644 new mode 100755 index 9646177..b62a63b --- a/demos/dragger.tcl +++ b/demos/dragger.tcl @@ -32,7 +32,7 @@ # $Id: demo.tcl,v 1.1 1997/09/17 21:10:23 donal Exp donal $ # Now we make cunning use of the backslash/shell trick \ -[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish8.0 $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } +[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } set dir [file join [pwd] [file dirname [info script]] ..] lappend auto_path [file join $dir ..] diff --git a/demos/fancytext.tcl b/demos/fancytext.tcl old mode 100644 new mode 100755 index a0bee3b..fff9e5b --- a/demos/fancytext.tcl +++ b/demos/fancytext.tcl @@ -32,7 +32,7 @@ # $Id: demo.tcl,v 1.1 1997/09/17 21:10:23 donal Exp donal $ # Now we make cunning use of the backslash/shell trick \ -[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish8.0 $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } +[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } set dir [file join [pwd] [file dirname [info script]] ..] lappend auto_path [file join $dir ..] diff --git a/demos/fingerprint.tcl b/demos/fingerprint.tcl old mode 100644 new mode 100755 index 84151ac..94bdc92 --- a/demos/fingerprint.tcl +++ b/demos/fingerprint.tcl @@ -5,7 +5,7 @@ # a little in order to increase its effectiveness. # Now we make cunning use of the backslash/shell trick \ -[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish8.0 $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } +[ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } set dir [file join [pwd] [file dirname [info script]] ..] lappend auto_path [file join $dir ..] From 5df99008cfcce2cf9cb46580e3081dcd1aa35111 Mon Sep 17 00:00:00 2001 From: Andy Bennett Date: Fri, 11 Aug 2023 16:28:06 +0100 Subject: [PATCH 3/4] Help the demos find the library and their resources There are no installation targets provided to install the library in a well-known location. unix/pkgIndex.tcl contains some code to help scripts find the library and to perform a renaming dance but this code isn't available in a well-known location either. ...so this patch simply copy & pastes the snippet from unix/pkgIndex.tcl to where it is needed to make the demos work. The existing definition of `dir` prevents the demos from finding their image resources and isn't compatible with the unix/pkgIndex.tcl library loading trick so this patch also fixes it up so that it works for me. Signed-off-by: Andy Bennett --- demos/dragger.tcl | 4 +++- demos/fancytext.tcl | 4 +++- demos/fingerprint.tcl | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/demos/dragger.tcl b/demos/dragger.tcl index b62a63b..1563660 100755 --- a/demos/dragger.tcl +++ b/demos/dragger.tcl @@ -34,7 +34,9 @@ # Now we make cunning use of the backslash/shell trick \ [ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } -set dir [file join [pwd] [file dirname [info script]] ..] +set dir [file join [pwd] [file dirname [info script]] .] +package ifneeded Shape 0.4 "package require Tk 8\n\ + [list tclPkgSetup "$dir/../unix/" Shape 0.4 {{libshape04.so.1.0 load shape}}]" lappend auto_path [file join $dir ..] package require Shape diff --git a/demos/fancytext.tcl b/demos/fancytext.tcl index fff9e5b..6393488 100755 --- a/demos/fancytext.tcl +++ b/demos/fancytext.tcl @@ -34,7 +34,9 @@ # Now we make cunning use of the backslash/shell trick \ [ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } -set dir [file join [pwd] [file dirname [info script]] ..] +set dir [file join [pwd] [file dirname [info script]] .] +package ifneeded Shape 0.4 "package require Tk 8\n\ + [list tclPkgSetup "$dir/../unix/" Shape 0.4 {{libshape04.so.1.0 load shape}}]" lappend auto_path [file join $dir ..] package require Shape diff --git a/demos/fingerprint.tcl b/demos/fingerprint.tcl index 94bdc92..79ef1fb 100755 --- a/demos/fingerprint.tcl +++ b/demos/fingerprint.tcl @@ -7,7 +7,9 @@ # Now we make cunning use of the backslash/shell trick \ [ -x `dirname $0`/../shapewish ] && exec `dirname $0`/../shapewish $0 ${1+"$@"} || exec wish $0 ${1+"$@"} || { echo "`basename $0`: couldn't start wish" >&2 ; exit 1; } -set dir [file join [pwd] [file dirname [info script]] ..] +set dir [file join [pwd] [file dirname [info script]] .] +package ifneeded Shape 0.4 "package require Tk 8\n\ + [list tclPkgSetup "$dir/../unix/" Shape 0.4 {{libshape04.so.1.0 load shape}}]" lappend auto_path [file join $dir ..] package require Shape From 8f65b925cc15266c3e48f75d9d6186728a6c6046 Mon Sep 17 00:00:00 2001 From: Andy Bennett Date: Fri, 11 Aug 2023 16:28:34 +0100 Subject: [PATCH 4/4] Fix up the comments that explain the fancytext.tcl demo script. Signed-off-by: Andy Bennett --- demos/fancytext.tcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demos/fancytext.tcl b/demos/fancytext.tcl index 6393488..3cada9f 100755 --- a/demos/fancytext.tcl +++ b/demos/fancytext.tcl @@ -1,8 +1,9 @@ #!/bin/sh -# dragger.tcl --- +# fancytext.tcl --- # -# Quick demo using the shape library to provide a coloured cursor +# Make a piece of text look interesting by suggesting the shape of the +# letters # # Copyright (c) 1997 by Donal K. Fellows #