Add tkshape 0.4, a Tk library to access to X Shaped Window Extension.

PR:		ports/70845
Submitted by:	nivit(at)users.sourceforge.net
This commit is contained in:
Alexey Dokuchaev 2005-03-17 11:55:31 +00:00
parent 1d601be25d
commit a196bc0545
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=131496
12 changed files with 365 additions and 0 deletions

View File

@ -187,6 +187,7 @@
SUBDIR += tk82
SUBDIR += tk83
SUBDIR += tk84
SUBDIR += tkshape
SUBDIR += tkstep80
SUBDIR += tktable
SUBDIR += v

View File

@ -0,0 +1,95 @@
# New ports collection makefile for: TkShape
# Date created: 13 March 2004
# Whom: nivit@users.sourceforge.net
#
# $FreeBSD$
PORTNAME= tkshape
PORTVERSION= 0.4
CATEGORIES= x11-toolkits
MASTER_SITES= http://www.cs.man.ac.uk/~fellowsd/tcl/
DISTNAME= shape${PORTVERSION:S/.//g}
MAINTAINER= nivit@users.sourceforge.net
COMMENT= A Tk library to access to X Shaped Window Extension
LIB_DEPENDS= tk84.1:${PORTSDIR}/x11-toolkits/tk84
PLIST_SUB= PORTNAME="${PORTNAME}"
INSTALLS_SHLIB= yes
OPTIONS= MANPAGES "Install manual pages" on
.include <bsd.port.pre.mk>
.if defined(WITH_MANPAGES)
MAN3= CombShape.3 QuryShape.3
MANN= shape.n
.endif
WRKSRC= ${WRKDIR}/${PORTNAME:C/^tk//1}${PORTVERSION}
TCL_VER?= 8.4
TK_VER?= 8.4
WISH?= wish${TK_VER}
USE_GMAKE= yes
USE_REINPLACE= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-tclconf=${LOCALBASE}/lib/tcl${TCL_VER} \
--with-tkconf=${LOCALBASE}/lib/tk${TK_VER}
CONFIGURE_WRKSRC= ${WRKSRC}/unix
BUILD_WRKSRC= ${CONFIGURE_WRKSRC}
WHERE_REPLACE= ${WRKSRC}/demos
REPLACE_FILES= ${WHERE_REPLACE}/dragger.tcl \
${WHERE_REPLACE}/fancytext.tcl \
${WHERE_REPLACE}/fingerprint.tcl
post-patch: .SILENT
for FILE in ${REPLACE_FILES}; do \
${REINPLACE_CMD} -e "/%%WISH%%/s//${WISH:S/\//\\\//g}/g" \
$${FILE}; \
done;
${REINPLACE_CMD} -E 's,(^CFLAGS = )-g,\1${CFLAGS},' \
${BUILD_WRKSRC}/Makefile.in
FIND_DIRS= -type d \! -empty
FIND_DEMOS= demos -type f -and -name "*.tcl" -maxdepth 1
FIND_IMAGES= demos/images -type f \
-and \( -name "*.gif" -or -name "*.xbm" \
-or -name "*.cur" \)
TARGET_DIR= ${PREFIX}/lib/${PORTNAME}
MANPAGES= ${MAN3} ${MANN}
do-install:
# script, library
cd ${WRKSRC}; \
${MKDIR} ${TARGET_DIR}/demos; \
FILES=$$(${FIND} ${FIND_DEMOS}); \
for FILE in $${FILES}; do \
${INSTALL_SCRIPT} $${FILE} ${TARGET_DIR}/$${FILE}; \
done; \
${INSTALL_SCRIPT} unix/libshape04.so.1.0 ${TARGET_DIR}/libshape04.so.1;
# images, pkgIndex.tcl
cd ${WRKSRC}; \
${MKDIR} ${TARGET_DIR}/demos/images; \
FILES=$$(${FIND} ${FIND_IMAGES}); \
for FILE in $${FILES}; do \
${INSTALL_DATA} $${FILE} ${TARGET_DIR}/$${FILE}; \
done; \
${INSTALL_DATA} unix/pkgIndex.tcl ${TARGET_DIR}/pkgIndex.tcl;
# manpages
.if defined(WITH_MANPAGES)
cd ${WRKSRC}; \
for m in ${MANPAGES} ; do \
s=$${m##*.}; \
${INSTALL_MAN} doc/$${m} ${MANPREFIX}/man/man$${s}/$${m}; \
done;
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
MD5 (shape04.tar.gz) = bd05d36795b00195bb072fac9c35dc8d
SIZE (shape04.tar.gz) = 62205

View File

@ -0,0 +1,14 @@
--- demos/dragger.tcl Mon Sep 11 12:01:58 2000
+++ demos/dragger.tcl.new Sun Mar 14 14:36:20 2004
@@ -32,9 +32,9 @@
# $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]] ..]
+set dir [file join [pwd] [file dirname [info script]]]
lappend auto_path [file join $dir ..]
package require Shape

View File

@ -0,0 +1,14 @@
--- demos/fancytext.tcl Mon Sep 11 12:01:58 2000
+++ demos/fancytext.tcl.new Sun Mar 14 14:36:43 2004
@@ -32,9 +32,9 @@
# $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]] ..]
+set dir [file join [pwd] [file dirname [info script]]]
lappend auto_path [file join $dir ..]
package require Shape

View File

@ -0,0 +1,14 @@
--- demos/fingerprint.tcl Mon Sep 11 12:01:58 2000
+++ demos/fingerprint.tcl.new Sun Mar 14 14:37:13 2004
@@ -5,9 +5,9 @@
# 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]] ..]
+set dir [file join [pwd] [file dirname [info script]]]
lappend auto_path [file join $dir ..]
package require Shape

View File

@ -0,0 +1,163 @@
diff -ur generic/shape.c shape0.4.new/generic/shape.c.new
--- generic/shape.c Mon Sep 11 17:16:31 2000
+++ generic/shape.c.new Fri Jan 30 15:20:15 2004
@@ -25,7 +25,6 @@
#include <tkInt.h>
#endif
#include <X11/Xutil.h>
-#include "panic.h"
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)<(y)?(y):(x))
@@ -38,6 +37,10 @@
_ANSI_ARGS_((Tk_Window tkwin, Tcl_Interp *interp, int x, int y, int op,
int kind, int objc, Tcl_Obj *CONST objv[]));
+static Tk_Window getWindow(Tk_Window, Tcl_Interp*, Tcl_Obj*, int *);
+
+int Shape_Init(Tcl_Interp *);
+
static int
shapeBoundClipOps _ANSI_ARGS_((Tk_Window tkwin, Tcl_Interp *interp, int opnum,
int objc, Tcl_Obj *CONST objv[]));
@@ -76,7 +79,7 @@
enum {
boundsCmd, getCmd, offsetCmd, setCmd, updateCmd, versionCmd
};
-static char *subcommands[] = {
+static CONST char *subcommands[] = {
"bounds", "get", "offset", "set", "update", "version", NULL
};
static shapeCommandHandler shapeCommandHandlers[] = {
@@ -133,7 +136,7 @@
int opnum, objc;
Tcl_Obj *CONST objv[];
{
- static char *options[] = {
+ static CONST char *options[] = {
"-bounding", "-clip", NULL
};
int idx = 0,toplevel;
@@ -160,7 +163,7 @@
return TCL_ERROR;
}
if (valid) {
- Tcl_Obj *r, *result[4];
+ Tcl_Obj /* *r, */ *result[4];
result[0] = Tcl_NewIntObj(x1);
result[1] = Tcl_NewIntObj(y1);
@@ -178,6 +181,8 @@
default: /* should be impossible to get here! */
panic("unexpected operation number %d", opnum);
}
+
+ return TCL_OK;
}
static int
@@ -187,12 +192,14 @@
int opnum, objc;
Tcl_Obj *CONST objv[];
{
- static char *opts[] = {
+ static CONST char *opts[] = {
"-bounding", "-clip", "-both", NULL
};
int x,y,toplevel, i = SHAPE_KIND_BOTH-1;
Tk_Window tkwin;
+ opnum = 0; /* unused */
+
/* Argument parsing */
switch (objc) {
default:
@@ -256,6 +263,8 @@
XRectangle *rects;
int count,i,result;
+ x = y = op = 0; /* unused */
+
if (objc != 1) {
Tcl_AppendResult(interp, "rectangles requires one argument; "
"a list of rectangles", NULL);
@@ -309,6 +318,10 @@
int x, y, op, kind, objc;
Tcl_Obj *CONST objv[];
{
+
+ x = y = op; /* unused */
+ objv = NULL; /* unused */
+
if (objc != 0) {
Tcl_AppendResult(interp, "reset takes no arguments", NULL);
return TCL_ERROR;
@@ -327,6 +340,8 @@
XRectangle *rects;
int count, result;
+ x = y; /* unused */
+
if (objc != 2) {
Tcl_AppendResult(interp, "text requires two arguments; the string "
"to display and the font to use to display it",
@@ -356,8 +371,7 @@
Tcl_Obj *CONST objv[];
{
Tk_Window srcwin;
- int ignore, result;
- Display *dpy;
+ int ignore;
if (objc != 1) {
Tcl_AppendResult(interp, "window requires one argument; a window "
@@ -388,7 +402,7 @@
return TCL_ERROR;
}
- imageName = Tcl_GetStringFromObj(objv[0], &NULL);
+ imageName = Tcl_GetStringFromObj(objv[0], NULL);
handle = Tk_FindPhoto(interp, imageName);
if (handle == NULL) {
return TCL_ERROR;
@@ -418,19 +432,19 @@
enum optkind {
shapekind, offsetargs, sourceargs
};
- static char *options[] = {
+ static CONST char *options[] = {
"-offset",
"-bounding", "-clip", "-both",
"bitmap", "rectangles", "reset", "text", "window",
#ifdef SUPPORTS_PHOTO_REGION
- "photo"
+ "photo",
#endif
NULL
};
static enum optkind optk[] = {
offsetargs,
shapekind, shapekind, shapekind,
- sourceargs, sourceargs, sourceargs, sourceargs, sourceargs
+ sourceargs, sourceargs, sourceargs, sourceargs, sourceargs,
#ifdef SUPPORTS_PHOTO_REGION
sourceargs
#endif
@@ -458,7 +472,7 @@
idx = 3;
break;
case updateCmd: {
- static char *operations[] = {
+ static CONST char *operations[] = {
"set", "union", "intersect", "subtract", "invert",
":=", "+=", "*=", "-=", "=", "||", "&&", NULL
};
@@ -570,6 +584,8 @@
default: /* should be impossible to get here! */
panic("switch fallthrough");
}
+
+ return TCL_OK;
}
int

View File

@ -0,0 +1,20 @@
diff -ur unix/configure unix/configure.new
--- unix/configure Thu Sep 14 12:15:35 2000
+++ unix/configure.new Sat Mar 13 11:15:06 2004
@@ -448,13 +448,13 @@
CC=$TCL_CC
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
SHLIB_LD=$TCL_SHLIB_LD
-SHLIB_LD_LIBS="-lXext $TCL_SHLIB_LD_LIBS"
+SHLIB_LD_LIBS="$TCL_SHLIB_LD_LIBS $TK_LIBS -lXext"
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
SHLIB_VERSION=$TCL_SHLIB_VERSION
TCL_LIBS=$TCL_LIBS
TCL_VERSION=$TCL_VERSION
-TCL_INCLUDE=$TCL_PREFIX/include
-TK_INCLUDE=$TK_PREFIX/include
+TCL_INCLUDE=$TCL_PREFIX/include/tcl$TCL_VERSION
+TK_INCLUDE=$TK_PREFIX/include/tk$TK_VERSION
TCL_BIN_DIR=$TK_EXEC_PREFIX/bin
echo $ac_n "checking for -lXext""... $ac_c" 1>&6

View File

@ -0,0 +1,8 @@
--- unix/pkgIndex.tcl Mon Sep 11 16:27:28 2000
+++ unix/pkgIndex.tcl.new Sun Mar 14 13:29:27 2004
@@ -5,4 +5,4 @@
# broken OSes like SunOS4. If you have a problem with this, tough!
package ifneeded Shape 0.4 "package require Tk 8\n\
- [list tclPkgSetup $dir Shape 0.4 {{libshape04.so.1.0 load shape}}]"
+ [list tclPkgSetup $dir Shape 0.4 {{libshape04.so.1 load shape}}]"

View File

@ -0,0 +1,11 @@
diff -ur unix/shapeUnixImpl.c unix/shapeUnixImpl.c.new
--- unix/shapeUnixImpl.c Mon Sep 11 16:27:28 2000
+++ unix/shapeUnixImpl.c Sat Mar 13 11:25:54 2004
@@ -16,6 +16,7 @@
#include <X11/Xutil.h> /* For Region declaration. */
#include <X11/extensions/shape.h>
#include "shape.h"
+#include "shapeInt.h"
#ifdef DKF_SHAPE_DEBUGGING
static int

View File

@ -0,0 +1,8 @@
This Tcl/Tk extension offers raw access to the X Shaped Window
Extension.
WWW: http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html
--
Nicola Vitale
nivit@users.sourceforge.net

View File

@ -0,0 +1,15 @@
lib/%%PORTNAME%%/libshape04.so.1
lib/%%PORTNAME%%/pkgIndex.tcl
lib/%%PORTNAME%%/demos/dragger.tcl
lib/%%PORTNAME%%/demos/fancytext.tcl
lib/%%PORTNAME%%/demos/fingerprint.tcl
lib/%%PORTNAME%%/demos/images/doc-img.gif
lib/%%PORTNAME%%/demos/images/doc-mask.xbm
lib/%%PORTNAME%%/demos/images/fingerprint.xbm
lib/%%PORTNAME%%/demos/images/none.cur
lib/%%PORTNAME%%/demos/images/ptr-green.gif
lib/%%PORTNAME%%/demos/images/ptr-mask.xbm
lib/%%PORTNAME%%/demos/images/ptr-red.gif
@dirrm lib/%%PORTNAME%%/demos/images
@dirrm lib/%%PORTNAME%%/demos
@dirrm lib/%%PORTNAME%%