Commit 31b9c51a authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

remove tkpath

parent 022f2f27
/ChangeLog/1.13/Wed Jul 4 19:43:18 2012//
/ Jul 4 18:49:06 2012//
/README.txt/1.10/Thu May 22 06:20:51 2008//
/TODO/1.17/Fri Jul 25 06:17:08 2008//
/aclocal.m4/1.2/Tue Jan 23 16:17:49 2007//
/configure/1.18/Wed Jul 4 20:43:01 2012//
/ Jul 4 20:43:21 2012//
/ Apr 1 00:34:21 2009//
A D/demos////
A D/doc////
A D/generic////
A D/library////
A D/macosx////
A D/tclconfig////
A D/tests////
A D/unix////
A D/win////
2013-09-12 Ivica Ico Bukvic <>
* moved bbox and totalBbox to Tk_PathItem to make it visible
to Translate calls that previously failed to take into
account transforms via matrices (e.g. scale). This resulted
in artifacts left behind when translating objects with
scaling matrices applied to them (the same solves scale
calls and potentially ensuing artifacts as well)
* adapted all objects to reflect aforesaid change
* merged patch by Sean McKnight found at:
2012-07-04 George Petasis <>
* generic/tkpUtil.c: Fix in the tkStateKeyObjType definistion, in
order to compile with Tk 8.6.
* tclconfig/install-sh:
* tclconfig/tcl.m4:
* configure, Updated to TEA 3.9.
* generic/*.c: Various fixes for mingw32/mingw64.
* configure, Bumped revision to 0.3.3
2011-10-28 Peter Spjuth <>
* win/
* generic/path.c:
* configure, Bumped revision to 0.3.2
2011-10-28 Peter Spjuth <>
* generic/tkCanvPath.c (PathCoords):
Fixed memory leak when using coords command with path item.
2010-03-15 Peter Spjuth <>
* generic/tkIntPath.h: Updated PATH_DEPIXELIZE to avoid an offset
error with negative coordinates.
* demos/arcs.tcl: Added an arc where the offset error was visible.
2010-03-15 Peter Spjuth <>
* unix/tkUnixCairoPath.c (TkPathInit): Get correct size of Drawable.
This fixes an intermittent strange clipping bug.
2010-03-10 George Petasis <>
* generic/tkpCanvPoly.c: fixes in DeletePolygon() to avoid double
releases of polyPtr->coordPtr & polyPtr->fillGC by
* generic/tkpCanvUtil.c: fixes in Tk_PathDeleteOutline(), to set the
default empty values in the various Tk_PathOutline members, to stop
double releases done by Tk_FreeConfigOptions() (i.e. by
DeletePolygon() in tkpCanvPoly.c).
* generic/tkpCanvas.c: fix in DestroyCanvas(), so as
TkPathCanvasItemIteratorPrev() accepts a pointer that has not been
just freed.
* generic/tkpUtil.c: added a CONST before tkStateKeyObjType, to get
the code to compile with Tk 8.6.
* win/tkWinGDIPlusPath.cpp: changed the file from Mac OS X format to
windows, as the MS C++ 10.0 compiler stopped with an error.
* win/ I updated the windows makefile, to compile tkpath
with VC++ 10.0 compiler. May need further tweaking to work with
earlier versions.
2009-04-01 Jeff Hobbs <>
* (VPATH): add macosx subdir to VPATH
2009-03-31 Jeff Hobbs <>
*, tclconfig/config.m4: updated to TEA 3.7 and improved
* configure, Makefile for Windows build
* win/tkWinGDIPlusPath.cpp: clarify TkPathContext_ typedef
* use a more flexible starter
* generic/tkPathStyle.c (Tk_PathDashOptionSetProc): initialize newPtr
# --
# This file is a Makefile for Sample TEA Extension. If it has the name
# "" then it is a template for a Makefile; to generate the
# actual Makefile, run "./configure", which is a configuration script
# generated by the "autoconf" program (constructs like "@foo@" will get
# replaced in the actual Makefile.
# Copyright (c) 1999 Scriptics Corporation.
# Copyright (c) 2002-2005 ActiveState Corporation.
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# RCS: @(#) $Id$
# Add additional lines to handle any additional AC_SUBST cases that
# have been added in a customized configure script.
# Nothing of the variables below this line should need to be changed.
# Please check the TARGETS section below to make sure the make targets
# are correct.
# The names of the source files is defined in the configure script.
# The object files are used for linking into the final library.
# This will be used when a dist target is added to the Makefile.
# It is not important to specify the directory, as long as it is the
# $(srcdir) or in the generic, win or unix subdirectory.
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
# This is a list of public header files to be installed, if any.
# "PKG_LIB_FILE" refers to the library (dynamic or static as per
# configuration options) composed of the named objects.
BINARIES = $(lib_BINARIES) pkgIndex.tcl
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
datadir = @datadir@
mandir = @mandir@
pkgdatadir = $(datadir)/$(PKG_DIR)
pkglibdir = $(libdir)/$(PKG_DIR)
pkgincludedir = $(includedir)/$(PKG_DIR)
top_builddir = .
INSTALL = $(SHELL) $(srcdir)/tclconfig/install-sh -c ${INSTALL_OPTIONS}
CC = @CC@
# Not used, but retained for reference of what libs Tcl required
# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
# package without installing. The other environment variables allow us
# to test against an uninstalled Tcl. Add special env vars that you
# require for testing here (like TCLX_LIBRARY).
EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
TCLLIBPATH = $(top_builddir)
TKPATH_LIBRARY="`@CYGPATH@ $(srcdir)/library`"
# TCL_DEFS is not strictly need here, but if you remove it, then you
# must make sure that checks for the necessary components
# that your library may use. TCL_DEFS can actually be a problem if
# you do not compile with a similar machine setup as the Tcl core was
# compiled with.
AR = @AR@
# Start of user-definable TARGETS section
# TEA TARGETS. Please note that the "libraries:" target refers to platform
# independent files, and the "binaries:" target inclues executable programs and
# platform-dependent libraries. Modify these targets so that they install
# the various pieces of your package. The make and install rules
# for the BINARIES that you specified above have already been done.
all: binaries libraries doc
# The binaries target builds executable programs, Windows .dll's, unix
# shared/static libraries, and any other platform-dependent files.
# The list of targets to build for "binaries:" is specified at the top
# of the Makefile, in the "BINARIES" variable.
binaries: $(BINARIES)
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.
@echo "If you have documentation to create, place the commands to"
@echo "build the docs in the 'doc:' target. For example:"
@echo " xml2nroff sample.xml > sample.n"
@echo " xml2html sample.xml > sample.html"
install: all install-binaries install-libraries install-doc
install-binaries: binaries install-lib-binaries install-bin-binaries
# This rule installs platform-independent files, such as header files.
# The list=...; for p in $$list handles the empty list case x-platform.
install-libraries: libraries
@mkdir -p $(DESTDIR)$(includedir)
@echo "Installing header files in $(DESTDIR)$(includedir)"
@list='$(PKG_HEADERS)'; for i in $$list; do \
echo "Installing $(srcdir)/$$i" ; \
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
# Install documentation. Unix manpages should go in the $(mandir)
# directory.
install-doc: doc
@mkdir -p $(DESTDIR)$(mandir)/mann
@echo "Installing documentation in $(DESTDIR)$(mandir)"
@list='$(srcdir)/doc/*.n'; for i in $$list; do \
echo "Installing $$i"; \
rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
$(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \
# Piping to cat is necessary on Windows to see the output, and
# harmless on Unix
test: binaries libraries
$(WISH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) | cat
demo: binaries libraries
$(WISH) `@CYGPATH@ $(srcdir)/demos/all.tcl` $(TESTFLAGS) | cat
shell: binaries libraries
# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
# mentioned above. That will ensure that this target is built when you
# run "make binaries".
# The $(PKG_OBJECTS) objects are created and linked into the final
# library. In most cases these object files will correspond to the
# source files above.
-rm -f $(PKG_LIB_FILE)
# We need to enumerate the list of .c to .o lines here.
# In the following lines, $(srcdir) refers to the toplevel directory
# containing your extension. If your sources are in a subdirectory,
# you will have to modify the paths to reflect this:
# sample.$(OBJEXT): $(srcdir)/generic/sample.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
# Setting the VPATH variable to a list of paths will cause the makefile
# to look into these paths when resolving .c to .obj dependencies.
# As necessary, add $(srcdir):$(srcdir)/compat:....
VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macosx
.cpp.@OBJEXT@ .c.@OBJEXT@:
$(COMPILE) -c `@CYGPATH@ $<` -o $@
# Create the pkgIndex.tcl file.
# It is usually easiest to let Tcl do this for you with pkg_mkIndex, but
# you may find that you need to customize the package. If so, either
# modify the -hand version, or create a file and have
# the configure script output the pkgIndex.tcl by editing
# ( echo pkg_mkIndex . $(PKG_LIB_FILE) \; exit; ) | $(TCLSH)
pkgIndex.tcl: $(srcdir)/
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
# Distribution creation
# You may need to tweak this target to make it work correctly.
#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
COMPRESS = gtar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
DIST_ROOT = /tmp/dist
rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
dist: dist-clean
mkdir -p $(DIST_DIR)
cp -p $(srcdir)/ChangeLog $(srcdir)/README* $(srcdir)/license* \
$(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/*.in \
chmod 664 $(DIST_DIR)/ $(DIST_DIR)/aclocal.m4
chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/
for i in $(srcdir)/*.[ch]; do \
if [ -f $$i ]; then \
cp -p $$i $(DIST_DIR)/ ; \
fi; \
mkdir $(DIST_DIR)/tclconfig
cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
chmod +x $(DIST_DIR)/tclconfig/install-sh
list='demos doc generic library mac tests unix win'; \
for p in $$list; do \
if test -d $(srcdir)/$$p ; then \
mkdir $(DIST_DIR)/$$p; \
cp -p $(srcdir)/$$p/*.* $(DIST_DIR)/$$p/; \
fi; \
# End of user-definable section
# Don't modify the file to clean here. Instead, set the "CLEANFILES"
# variable in
-test -z "$(BINARIES)" || rm -f $(BINARIES)
-rm -f *.$(OBJEXT) core *.core
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
-rm -f *.tab.c
-rm -f config.cache config.log config.status
# Install binary object libraries. On Windows this includes both .dll and
# .lib files. Because the .lib files are not explicitly listed anywhere,
# we need to deduce their existence from the .dll file of the same name.
# Library files go into the lib directory.
# In addition, this will generate the pkgIndex.tcl
# file in the install location (assuming it can find a usable tclsh shell)
# You should not have to modify this target.
install-lib-binaries: binaries
@mkdir -p $(DESTDIR)$(pkglibdir)
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
ext=`echo $$p|sed -e "s/.*\.//"`; \
if test "x$$ext" = "xdll"; then \
lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
if test -f $$lib; then \
echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
$(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
fi; \
fi; \
fi; \
@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
destp=`basename $$p`; \
echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \
fi; \
@echo "Installing pkgIndex.tcl in $(DESTDIR)$(pkglibdir)";
@$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir);
# Install binary executables (e.g. .exe files and dependent .dll files)
# This is for files that must go in the bin directory (located next to
# wish and tclsh), like dependent .dll files on Windows.
# You should not have to modify this target, except to define bin_BINARIES
# above if necessary.
install-bin-binaries: binaries
@mkdir -p $(DESTDIR)$(bindir)
@list='$(bin_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
fi; \
Makefile: $(srcdir)/ $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
list='$(lib_BINARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
p=`basename $$p`; \
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
list='$(bin_BINARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/$$p; \
.PHONY: all binaries clean depend distclean doc install libraries test
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
README for tkpath
This package implements path drawing modelled after its SVG counterpart,
see See the doc directory for more info.
There are three backends used for drawing. They are all platform specific
except for the Tk drawing which uses only the API found in Tk. This
backend is very limited and has some problems with multiple subpaths.
It is only to be used as a fallback when the cairo backend is missing.
The backends:
1) CoreGraphics for MacOSX, built using ProjectBuilder
2) GDI+ for WinXP, built by VC++7 (.NET), runs also on older system
using the gdiplus.dll
3) cairo (, built using the automake system;
the and files are a hack, so please help
yourself (and me). It requires a cairo 1.0 installation since
incompatible API changes appeared before 1.0 ( ?).
There used to be two additional backends, GDI and core Tk drawing, but
these have been dropped.
I could think of another backend based on X11 that has more features than
the compatibility layer of Tk, since the fallback is only necessary on unix
systems anyway. Perhaps an OpenGL backend would also be useful, mainly on
unix systems without cairo support.
There are two important Design Principles:
1) Follow the SVG graphics model. Make it more condensed without
giving up any features. For instance, tkpath keeps only a -matrix
option which comprises translate, scale etc. attributes
2) Keep the actual path drawing code separate and independent of any
canvas code.
Open Issues:
There are a number of design choices that I'd like to discuss.
o How to provide coordinates for prect? As the standard Tk way (x1,y1,x2,y2),
using sizes (x,y,width,height), or using options (x,y,-width,-height)?
o What shall the precedence of the -style option compared to the individual
options be?
Copyright (c) 2005-2008 Mats Bengtsson
BSD style license.
TODO + BUGS and undecided for tkpath
o The 'delete itemOrTag' may match items of any combination and therefore
deleteing a group may delete items already in the list which may crash.
o Scaling rotated arcs. Much math! Simplified.
Test case:
pack [tkp::canvas .c -width 600 -height 400]
set p "M 100 100 a 100 25 60 1 0 50 -25"
set id [.c create path $p]
set id [.c create path $p -stroke red -matrix {{2 0} {0 1} {0 0}}]
set id [.c create path $p -stroke blue]
.c scale $id 0 0 2 1
o Optimize segmentation computations used for hittesting in the 'Point'