Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d1dc9780c | ||
|
|
339acd56d0 | ||
|
|
91f69d62ce | ||
|
|
74d572d124 | ||
|
|
ab2b92a888 | ||
|
|
d3b395675c | ||
|
|
314ab41be8 | ||
|
|
eb4468f65e | ||
|
|
ba0d4a9bf3 | ||
|
|
0dfec72677 | ||
|
|
7bba62b94a | ||
|
|
f8f8061fa1 | ||
|
|
c08668adfb | ||
|
|
6ac755e0ee | ||
|
|
5aeb446da4 | ||
|
|
ad0245d1e4 | ||
|
|
548bc49665 | ||
|
|
2aa842bb62 | ||
|
|
9366c5b25d | ||
|
|
d8b5e7cdce | ||
|
|
315b4efc0b | ||
|
|
a378e5ced5 | ||
|
|
452e17181f | ||
|
|
cdf4c8607e | ||
|
|
70cb0cf259 | ||
|
|
ee9fddf301 | ||
|
|
cec7fda9f8 | ||
|
|
045a568df6 | ||
|
|
b336ee7e77 | ||
|
|
04744acf34 | ||
|
|
bc68443aa0 | ||
|
|
36e746ca9f | ||
|
|
3aa9aa6cf8 | ||
|
|
a5ac5ab426 | ||
|
|
72e59c83eb | ||
|
|
0b4cae3347 | ||
|
|
fbde373d0c | ||
|
|
3142d38c04 | ||
|
|
3bf8f18a8c | ||
|
|
0f4ca45c8d | ||
|
|
cf2e7dda18 | ||
|
|
dc8b3ab971 | ||
|
|
8da19b7e81 | ||
|
|
aa225e3764 | ||
|
|
4ea701440a | ||
|
|
e64eb4412a | ||
|
|
ff97dccb1f | ||
|
|
a3e94d8c17 | ||
|
|
300eaab4f1 | ||
|
|
e8e4fd3d40 | ||
|
|
162e614dd4 | ||
|
|
263fd23bd7 | ||
|
|
904fca0011 | ||
|
|
a4b9e4be90 | ||
|
|
0c9e32c247 | ||
|
|
9db842ec51 | ||
|
|
32c5f6da86 | ||
|
|
f0c3551671 | ||
|
|
2ba969314a | ||
|
|
6cc9350962 | ||
|
|
3a6b8273f7 | ||
|
|
bc7fd30c50 | ||
|
|
dfae7f1170 | ||
|
|
e6216a9765 | ||
|
|
4e0efdc834 | ||
|
|
31e47e5528 | ||
|
|
864f9e04f0 | ||
|
|
befa64adb4 | ||
|
|
e84228ec6f | ||
|
|
e2aa30d79a | ||
|
|
7e9fd2a84f | ||
|
|
03a6b07c2a | ||
|
|
756ae14d65 | ||
|
|
3f39aeb010 | ||
|
|
92eb3fdd44 | ||
|
|
807550ab46 | ||
|
|
4264944bc5 | ||
|
|
ed182ab9ff | ||
|
|
c3472f34bb | ||
|
|
fcc7d173fa | ||
|
|
68b793b87a | ||
|
|
63f658fb59 | ||
|
|
6b79771202 | ||
|
|
6be229ae53 | ||
|
|
ce58bc8279 | ||
|
|
9b3142c84d | ||
|
|
63c4fa3bdc | ||
|
|
437e8b4059 | ||
|
|
eff581f181 | ||
|
|
342411930a | ||
|
|
0fe316be45 | ||
|
|
3f4bef734e | ||
|
|
585333f5c1 | ||
|
|
37ab0130ef | ||
|
|
08221de29a | ||
|
|
3f8beefad4 | ||
|
|
e6e61779cd | ||
|
|
5000b01c87 | ||
|
|
0fcc19e67d | ||
|
|
20c73bab41 | ||
|
|
31f92cde5a | ||
|
|
a531e8edd5 | ||
|
|
36123d8a6e | ||
|
|
1650e4fc9b | ||
|
|
990d530725 | ||
|
|
f3579fe671 | ||
|
|
4da7a342ad | ||
|
|
7546bc92e8 | ||
|
|
95fcd6c702 | ||
|
|
c846fa59ef | ||
|
|
45935c54e3 | ||
|
|
ba1c4efb37 | ||
|
|
42b60508df | ||
|
|
14a579aa7d | ||
|
|
6318f7aac8 | ||
|
|
3a65b04039 | ||
|
|
a9da66bbe5 | ||
|
|
472a148878 | ||
|
|
eba1e72b82 | ||
|
|
4f42e46e01 | ||
|
|
6cadbe907a | ||
|
|
e1d9ba44ce | ||
|
|
b662a46ea3 | ||
|
|
50202c0026 | ||
|
|
dbdc62f3d2 | ||
|
|
b0fe1a9c7e | ||
|
|
6c89d293c5 | ||
|
|
6cb1999183 | ||
|
|
3e1f9ae9be | ||
|
|
467aef124c | ||
|
|
be89d081a2 | ||
|
|
6aacc7322a | ||
|
|
4a2cdc827e | ||
|
|
82abd91e60 | ||
|
|
f2dca070fb | ||
|
|
6a4d29adaa | ||
|
|
f39bb55c9b | ||
|
|
8983513aab | ||
|
|
28ce02f137 | ||
|
|
ecc7d76cd6 | ||
|
|
6ac06f3ce1 | ||
|
|
c3ee1b6b3b | ||
|
|
63984cc3b4 | ||
|
|
ae06ce4d6e | ||
|
|
5a2ce1a8ba | ||
|
|
ec76842196 | ||
|
|
1cab8f25ff | ||
|
|
964fa9f3aa | ||
|
|
a8d7c39f8f | ||
|
|
2faf13d923 | ||
|
|
9032fb0f8e | ||
|
|
1fdcda9d52 | ||
|
|
f973f2210e | ||
|
|
2db3bbdca2 | ||
|
|
314bba292c | ||
|
|
aa5243a349 | ||
|
|
8142dcceff | ||
|
|
760816e24b | ||
|
|
ad50ad3656 | ||
|
|
f54996c058 | ||
|
|
8dcb8d1d6f | ||
|
|
5b309281f5 | ||
|
|
a4124c1c58 | ||
|
|
e69217725c | ||
|
|
03bdce61f5 | ||
|
|
475c9d6460 | ||
|
|
4515a31f80 | ||
|
|
ee4e0d9eb2 | ||
|
|
952261904a | ||
|
|
1431998fd2 | ||
|
|
368db3e92e | ||
|
|
3f5bc318e5 | ||
|
|
e19dc8d0ed | ||
|
|
b322a4612a | ||
|
|
339a46ab42 | ||
|
|
29594c7847 |
+431
@@ -0,0 +1,431 @@
|
||||
# Makefile.in --
|
||||
#
|
||||
# This file is a Makefile for Sample TEA Extension. If it has the name
|
||||
# "Makefile.in" 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-2004 ActiveState Corporation.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
#========================================================================
|
||||
# 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_SOURCES = @PKG_SOURCES@
|
||||
PKG_OBJECTS = @PKG_OBJECTS@
|
||||
|
||||
PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
|
||||
PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
|
||||
|
||||
#========================================================================
|
||||
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
|
||||
# this package that need to be installed, if any.
|
||||
#========================================================================
|
||||
|
||||
PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
|
||||
|
||||
#========================================================================
|
||||
# This is a list of header files to be installed
|
||||
# itk.h includes itclInt.h, which needs itclIntDecls.h,
|
||||
# so we must install them.
|
||||
#========================================================================
|
||||
|
||||
PKG_HEADERS = @PKG_HEADERS@
|
||||
|
||||
#========================================================================
|
||||
# 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.
|
||||
#========================================================================
|
||||
|
||||
itk_LIB_FILE = @itk_LIB_FILE@
|
||||
itkstub_LIB_FILE = @itkstub_LIB_FILE@
|
||||
itclstub_LIB_FILE = @itclstub_LIB_FILE@
|
||||
|
||||
#========================================================================
|
||||
# Add additional lines to handle any additional AC_SUBST cases that
|
||||
# have been added to the configure script.
|
||||
#========================================================================
|
||||
|
||||
ITK_GENERIC_DIR_NATIVE = @ITK_GENERIC_DIR_NATIVE@
|
||||
ITK_UNIX_DIR_NATIVE = @ITK_UNIX_DIR_NATIVE@
|
||||
ITK_WIN_DIR_NATIVE = @ITK_WIN_DIR_NATIVE@
|
||||
|
||||
#========================================================================
|
||||
# Nothing of the variables below this line need to be changed. Please
|
||||
# check the TARGETS section below to make sure the make targets are
|
||||
# correct.
|
||||
#========================================================================
|
||||
|
||||
#========================================================================
|
||||
# Change the name of the variable "exampleA_LIB_FILE" to match the one
|
||||
# used in the configure script. This is the parameterized name of the
|
||||
# library that we are building.
|
||||
#========================================================================
|
||||
|
||||
PKG_LIB_FILE = @PKG_LIB_FILE@
|
||||
PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
|
||||
|
||||
lib_BINARIES = $(PKG_LIB_FILE)
|
||||
BINARIES = $(lib_BINARIES)
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
datadir = @datadir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
|
||||
DESTDIR =
|
||||
|
||||
PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
|
||||
pkgdatadir = $(datadir)/$(PKG_DIR)
|
||||
pkglibdir = $(libdir)/$(PKG_DIR)
|
||||
pkgincludedir = $(includedir)/$(PKG_DIR)
|
||||
|
||||
top_builddir = .
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
CC = @CC@
|
||||
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
|
||||
CFLAGS_WARNING = @CFLAGS_WARNING@
|
||||
CLEANFILES = @CLEANFILES@
|
||||
EXEEXT = @EXEEXT@
|
||||
LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
|
||||
MAKE_LIB = @MAKE_LIB@
|
||||
MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
|
||||
MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
|
||||
MAKE_STUB_LIB = @MAKE_STUB_LIB@
|
||||
OBJEXT = @OBJEXT@
|
||||
RANLIB = @RANLIB@
|
||||
RANLIB_STUB = @RANLIB_STUB@
|
||||
SHLIB_CFLAGS = @SHLIB_CFLAGS@
|
||||
SHLIB_LD = @SHLIB_LD@
|
||||
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
|
||||
STLIB_LD = @STLIB_LD@
|
||||
TCL_DEFS = @TCL_DEFS@
|
||||
TCL_BIN_DIR = @TCL_BIN_DIR@
|
||||
TCL_SRC_DIR = @TCL_SRC_DIR@
|
||||
TK_SRC_DIR = @TK_SRC_DIR@
|
||||
TK_BIN_DIR = @TK_BIN_DIR@
|
||||
|
||||
# Not used, but retained for reference of what libs Tcl required
|
||||
TCL_LIBS = @TCL_LIBS@
|
||||
|
||||
#========================================================================
|
||||
# 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):$(TK_BIN_DIR)
|
||||
TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
|
||||
TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` \
|
||||
ITCL_LIBRARY=`@CYGPATH@ @itcl_SRC_DIR@/library` \
|
||||
ITK_LIBRARY=`@CYGPATH@ $(srcdir)/library` \
|
||||
@LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
|
||||
PATH="$(EXTRA_PATH):$(PATH)" \
|
||||
TCLLIBPATH="$(top_builddir) @itcl_BIN_DIR@"
|
||||
TCLSH_PROG = @TCLSH_PROG@
|
||||
WISH_PROG = @WISH_PROG@
|
||||
TCLSH = $(TCLSH_ENV) $(TCLSH_PROG)
|
||||
WISH = $(TCLSH_ENV) $(WISH_PROG)
|
||||
|
||||
INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
|
||||
|
||||
PKG_CFLAGS = @PKG_CFLAGS@
|
||||
|
||||
DEFS = @DEFS@ $(PKG_CFLAGS) \
|
||||
-DITK_LIBRARY=\"$(pkglibdir)\" -DUSE_NON_CONST
|
||||
|
||||
CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile itkConfig.sh pkgIndex.tcl
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LIBS = @PKG_LIBS@ @LIBS@
|
||||
AR = @AR@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
||||
#========================================================================
|
||||
# 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)
|
||||
|
||||
libraries:
|
||||
|
||||
doc:
|
||||
|
||||
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.
|
||||
#========================================================================
|
||||
|
||||
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) ; \
|
||||
done;
|
||||
|
||||
#========================================================================
|
||||
# Install documentation. Unix manpages should go in the $(mandir)
|
||||
# directory.
|
||||
#========================================================================
|
||||
|
||||
install-doc: doc
|
||||
@mkdir -p $(DESTDIR)$(mandir)/mann
|
||||
@echo "Installing man pages in $(DESTDIR)$(mandir)"
|
||||
@cd $(srcdir)/doc; for i in *.n; do \
|
||||
echo "Installing $$i"; \
|
||||
rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \
|
||||
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
|
||||
$$i > $(DESTDIR)$(mandir)/mann/$$i; \
|
||||
chmod 444 $(DESTDIR)$(mandir)/mann/$$i; \
|
||||
done
|
||||
|
||||
test: binaries libraries
|
||||
$(WISH) `@CYGPATH@ $(srcdir)/tests/all.tcl` -load "package require Itk $(PACKAGE_VERSION)" $(TESTFLAGS) | cat
|
||||
|
||||
shell: binaries libraries
|
||||
@$(WISH) $(SCRIPT)
|
||||
|
||||
gdb:
|
||||
$(TCLSH_ENV) gdb $(WISH_PROG) $(SCRIPT)
|
||||
|
||||
depend:
|
||||
|
||||
#========================================================================
|
||||
# $(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.
|
||||
#========================================================================
|
||||
|
||||
$(PKG_LIB_FILE): $(PKG_OBJECTS)
|
||||
-rm -f $(PKG_LIB_FILE)
|
||||
${MAKE_LIB}
|
||||
$(RANLIB) $(PKG_LIB_FILE)
|
||||
|
||||
$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
|
||||
-rm -f $(PKG_STUB_LIB_FILE)
|
||||
${MAKE_STUB_LIB}
|
||||
$(RANLIB_STUB) $(PKG_STUB_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:
|
||||
#
|
||||
# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c
|
||||
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.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)/unix:$(srcdir)/generic:$(srcdir)/win
|
||||
|
||||
.c.$(OBJEXT):
|
||||
$(COMPILE) -c `@CYGPATH@ $<` -o $@
|
||||
|
||||
#========================================================================
|
||||
# Distribution creation
|
||||
# You may need to tweak this target to make it work correctly.
|
||||
#========================================================================
|
||||
|
||||
TAR = tar
|
||||
#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
|
||||
COMPRESS = $(TAR) zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
|
||||
DIST_ROOT = /tmp/dist
|
||||
DIST_DIR = $(DIST_ROOT)/$(PKG_DIR)
|
||||
|
||||
dist-clean:
|
||||
rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
|
||||
|
||||
dist: dist-clean doc
|
||||
mkdir -p $(DIST_DIR)
|
||||
cp -p $(srcdir)/license* $(srcdir)/aclocal.m4 $(srcdir)/configure \
|
||||
$(srcdir)/*.in $(DIST_DIR)/
|
||||
chmod 664 $(DIST_DIR)/Makefile.in $(DIST_DIR)/aclocal.m4
|
||||
chmod 775 $(DIST_DIR)/configure $(DIST_DIR)/configure.in
|
||||
|
||||
mkdir $(DIST_DIR)/tclconfig
|
||||
cp $(srcdir)/tclconfig/install-sh $(srcdir)/tclconfig/tcl.m4 \
|
||||
$(DIST_DIR)/tclconfig/
|
||||
chmod 664 $(DIST_DIR)/tclconfig/tcl.m4
|
||||
chmod +x $(DIST_DIR)/tclconfig/install-sh
|
||||
|
||||
list='demos doc examples generic library tests win win/rc'; \
|
||||
for p in $$list; do \
|
||||
if test -d $(srcdir)/$$p ; then \
|
||||
mkdir $(DIST_DIR)/$$p; \
|
||||
for q in $(srcdir)/$$p/*; do \
|
||||
if test -f $$q ; then \
|
||||
cp -p $$q $(DIST_DIR)/$$p/; \
|
||||
fi; \
|
||||
done; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
list='CHANGES ChangeLog INCOMPATIBLE README TODO'; \
|
||||
for p in $$list; do \
|
||||
if test -f $(srcdir)/../$$p ; then \
|
||||
cp -p $(srcdir)/../$$p $(DIST_DIR)/; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
(cd $(DIST_ROOT); $(COMPRESS);)
|
||||
|
||||
#========================================================================
|
||||
# End of user-definable section
|
||||
#========================================================================
|
||||
|
||||
#========================================================================
|
||||
# Don't modify the file to clean here. Instead, set the "CLEANFILES"
|
||||
# variable in configure.in
|
||||
#========================================================================
|
||||
|
||||
clean:
|
||||
-test -z "$(BINARIES)" || rm -f $(BINARIES)
|
||||
-rm -f *.o core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean: clean
|
||||
-rm -f *.tab.c
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-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.
|
||||
# Additionally, the .dll files go into the bin directory, but the .lib
|
||||
# files go into the lib directory. On Unix platforms, all 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 tclsh8.2 shell)
|
||||
#
|
||||
# You should not have to modify this target.
|
||||
#========================================================================
|
||||
|
||||
install-lib-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; \
|
||||
stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
|
||||
if test "x$$stub" = "xstub"; then \
|
||||
echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
|
||||
$(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
|
||||
else \
|
||||
echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
|
||||
$(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
|
||||
fi; \
|
||||
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; \
|
||||
done
|
||||
@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; \
|
||||
done
|
||||
$(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir)
|
||||
: $(INSTALL_DATA) itkConfig.sh $(DESTDIR)$(libdir)
|
||||
|
||||
#========================================================================
|
||||
# Install binary executables (e.g. .exe files)
|
||||
#
|
||||
# You should not have to modify this target.
|
||||
#========================================================================
|
||||
|
||||
install-bin-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; \
|
||||
done
|
||||
|
||||
.SUFFIXES: .c .$(OBJEXT)
|
||||
|
||||
#Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
# cd $(top_builddir) \
|
||||
# && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
uninstall-binaries:
|
||||
list='$(lib_BINARIES)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
|
||||
done
|
||||
list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
|
||||
p=`basename $$p`; \
|
||||
rm -f $(DESTDIR)$(pkglibdir)/$$p; \
|
||||
done
|
||||
list='$(bin_BINARIES)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/$$p; \
|
||||
done
|
||||
|
||||
.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.
|
||||
.NOEXPORT:
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
builtin(include,tclconfig/tcl.m4)
|
||||
File diff suppressed because it is too large
Load Diff
+216
@@ -0,0 +1,216 @@
|
||||
#!/bin/bash -norc
|
||||
#--------------------------------------------------------------------
|
||||
# Sample configure.in for Tcl Extensions. The only places you should
|
||||
# need to modify this file are marked by the string __CHANGE__
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
|
||||
# set as provided. These will also be added as -D defs in your Makefile
|
||||
# so you can encode the package version directly into the source files.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
AC_INIT([itk], [3.4])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
|
||||
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
|
||||
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_INIT([3.9])
|
||||
|
||||
AC_PROG_LN_S
|
||||
CONFIG_CLEAN_FILES=
|
||||
if test ! -d $srcdir/tclconfig ; then
|
||||
if test -d $srcdir/../tclconfig ; then
|
||||
$LN_S $srcdir/../tclconfig tclconfig
|
||||
CONFIG_CLEAN_FILES=tclconfig
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CONFIG_CLEAN_FILES)
|
||||
|
||||
AC_CONFIG_AUX_DIR(tclconfig)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Load the tclConfig.sh file
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_PATH_TCLCONFIG
|
||||
TEA_LOAD_TCLCONFIG
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Load the tkConfig.sh file
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_PATH_TKCONFIG
|
||||
TEA_LOAD_TKCONFIG
|
||||
|
||||
TEA_PATH_CONFIG(itcl)
|
||||
TEA_LOAD_CONFIG(itcl)
|
||||
|
||||
ITCL_INCLUDES="-I\"`${CYGPATH} ${itcl_SRC_DIR}/generic`\""
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Handle the --prefix=... option by defaulting to what Tcl gave.
|
||||
# Must be called after TEA_LOAD_TCLCONFIG and before $prefix is used.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_PREFIX
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Standard compiler checks.
|
||||
# This sets up CC by using the CC env var, or looks for gcc otherwise.
|
||||
# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
|
||||
# the basic setup necessary to compile executables.
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
TEA_SETUP_COMPILER
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# __CHANGE__
|
||||
# Specify the C source files to compile in TEA_ADD_SOURCES,
|
||||
# public headers that need to be installed in TEA_ADD_HEADERS,
|
||||
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
|
||||
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
|
||||
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
|
||||
# and PKG_TCL_SOURCES.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
TEA_ADD_SOURCES([itk_cmds.c
|
||||
itk_option.c
|
||||
itk_archetype.c
|
||||
itk_util.c
|
||||
itkStubInit.c])
|
||||
TEA_ADD_HEADERS([generic/itk.h generic/itkDecls.h])
|
||||
TEA_ADD_INCLUDES([${ITCL_INCLUDES} -I\"`${CYGPATH} ${srcdir}/generic`\"])
|
||||
TEA_ADD_LIBS([])
|
||||
TEA_ADD_CFLAGS([])
|
||||
#TEA_ADD_STUB_SOURCES([itkStubLib.c])
|
||||
TEA_ADD_TCL_SOURCES([library/Archetype.itk
|
||||
library/Toplevel.itk
|
||||
library/Widget.itk
|
||||
library/itk.tcl
|
||||
library/tclIndex])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# __CHANGE__
|
||||
# A few miscellaneous platform-specific items:
|
||||
#
|
||||
# Windows creates a few extra files that need to be cleaned up.
|
||||
# You can add more files to clean if your extension creates any extra
|
||||
# files by extending CLEANFILES.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
if test "${TEA_PLATFORM}" = "windows" ; then
|
||||
TEA_ADD_SOURCES([dllEntryPoint.c])
|
||||
fi
|
||||
#CLEANFILES="$CLEANFILES *.ext"
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# __CHANGE__
|
||||
# Choose which headers you need. Extension authors should try very
|
||||
# hard to only rely on the Tcl public header files. Internal headers
|
||||
# contain private data structures and are subject to change without
|
||||
# notice.
|
||||
# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
|
||||
# so that we can extract TCL_SRC_DIR from the config file (in the case
|
||||
# of private headers
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#TEA_PUBLIC_TCL_HEADERS
|
||||
TEA_PRIVATE_TCL_HEADERS
|
||||
|
||||
#TEA_PUBLIC_TK_HEADERS
|
||||
TEA_PRIVATE_TK_HEADERS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# For Unix/Tk builds, make sure that the X libraries/headers are found.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_PATH_X
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# We need to enable the threading macros found in tcl.h and tclInt.h.
|
||||
# The use of the threading features is determined by the core the
|
||||
# extension is loaded into, but we need to compile with these macros
|
||||
# turned on.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFINE(TCL_THREADS)
|
||||
#--------------------------------------------------------------------
|
||||
# Check whether --enable-threads or --disable-threads was given.
|
||||
# This auto-enables if Tcl was compiled threaded.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#TEA_ENABLE_THREADS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# The statement below defines a collection of symbols related to
|
||||
# building as a shared library instead of a static library.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_ENABLE_SHARED
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# This macro figures out what flags to use with the compiler/linker
|
||||
# when building shared/static debug/optimized objects. This information
|
||||
# can be taken from the tclConfig.sh file, but this figures it all out.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_CONFIG_CFLAGS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Set the default compiler switches based on the --enable-symbols
|
||||
# option.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_ENABLE_SYMBOLS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Everyone should be linking against the Tcl stub library. If you
|
||||
# can't for some reason, remove this definition. If you aren't using
|
||||
# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
|
||||
# link against the non-stubbed Tcl library.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
if test "${SHARED_BUILD}" = "1" ; then
|
||||
AC_DEFINE(USE_TCL_STUBS)
|
||||
AC_DEFINE(USE_TK_STUBS)
|
||||
AC_DEFINE(USE_ITCL_STUBS)
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# This macro generates a line to use when building a library. It
|
||||
# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
|
||||
# and TEA_LOAD_TCLCONFIG macros above.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_MAKE_LIB
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# __CHANGE__
|
||||
# Change the name from exampeA_LIB_FILE to match your package name.
|
||||
# Use the stub_LIB_FILE substitution if your package creates a stub
|
||||
# library.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_SUBST(itkstub_LIB_FILE)
|
||||
AC_SUBST(itk_LIB_FILE)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
|
||||
# file during the install process. Don't run the TCLSH_PROG through
|
||||
# ${CYGPATH} because it's being used directly by make.
|
||||
# Require that we use a tclsh shell version 8.2 or later since earlier
|
||||
# versions have bugs in the pkg_mkIndex routine.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
TEA_PROG_TCLSH
|
||||
TEA_PROG_WISH
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Finally, substitute all of the various values into the Makefile.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_OUTPUT([Makefile pkgIndex.tcl itkConfig.sh])
|
||||
+10
-8
@@ -1,13 +1,13 @@
|
||||
#!/bin/sh
|
||||
#\
|
||||
exec itkwish $0
|
||||
exec wish8.4 "$0"
|
||||
# ======================================================================
|
||||
# Simple text editor built with [incr Widgets]
|
||||
# ----------------------------------------------------------------------
|
||||
# AUTHOR: Michael J. McLennan
|
||||
# CLASS: Object-Oriented Programming with [incr Tcl]
|
||||
# ======================================================================
|
||||
package require Iwidgets 2.1
|
||||
package require Iwidgets 4.0
|
||||
|
||||
option add *edit.width 5i startupFile
|
||||
option add *edit.height 4i startupFile
|
||||
@@ -20,24 +20,24 @@ set FileWindows 0
|
||||
# ----------------------------------------------------------------------
|
||||
# Dialog boxes
|
||||
# ----------------------------------------------------------------------
|
||||
messagedialog .notice -title "itkedit: Notice" \
|
||||
iwidgets::messagedialog .notice -title "itkedit: Notice" \
|
||||
-bitmap info -buttonboxpos e -modality application
|
||||
.notice hide OK
|
||||
.notice hide Help
|
||||
.notice buttonconfigure Cancel -text "Dismiss"
|
||||
|
||||
messagedialog .confirm -title "itkedit: Confirm" \
|
||||
iwidgets::messagedialog .confirm -title "itkedit: Confirm" \
|
||||
-bitmap questhead -modality application
|
||||
.confirm hide Help
|
||||
.confirm buttonconfigure OK -text "Yes"
|
||||
.confirm buttonconfigure Cancel -text "No"
|
||||
|
||||
fileselectiondialog .files -title "itkedit: Files" \
|
||||
iwidgets::fileselectiondialog .files -title "itkedit: Files" \
|
||||
-childsitepos s -modality application
|
||||
.files hide Help
|
||||
|
||||
set PaneMenu "[.files childsite].panes"
|
||||
optionmenu $PaneMenu -labeltext "Edit Window:"
|
||||
iwidgets::optionmenu $PaneMenu -labeltext "Edit Window:"
|
||||
pack $PaneMenu -pady 6
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -168,7 +168,7 @@ proc split_view {} {
|
||||
set FileName($win) untitled.txt
|
||||
set FileChanged($win) 0
|
||||
|
||||
scrolledtext $win.text -wrap none -labeltext "file: $FileName($win)" \
|
||||
iwidgets::scrolledtext $win.text -wrap none -labeltext "file: $FileName($win)" \
|
||||
-hscrollmode none -vscrollmode dynamic -visibleitems 1x1
|
||||
pack $win.text -expand yes -fill both
|
||||
|
||||
@@ -213,7 +213,7 @@ menu .mbar.view.menu
|
||||
# ----------------------------------------------------------------------
|
||||
# Editor
|
||||
# ----------------------------------------------------------------------
|
||||
panedwindow .edit -orient horizontal
|
||||
iwidgets::panedwindow .edit -orient horizontal
|
||||
pack .edit -expand yes -fill both
|
||||
|
||||
split_view
|
||||
@@ -225,3 +225,5 @@ after idle {
|
||||
update idletasks
|
||||
wm minsize . [winfo reqwidth .] [winfo reqheight .]
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-8
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: Archetype.n,v 1.1 1998/07/27 18:45:35 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Archetype n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
@@ -192,7 +190,7 @@ override settings determined from the X11 resource database.
|
||||
The arguments to the constructor are usually passed along
|
||||
to this method as follows:
|
||||
.CS
|
||||
class MyWidget {
|
||||
itcl::class MyWidget {
|
||||
inherit Widget
|
||||
|
||||
constructor {args} {
|
||||
@@ -230,7 +228,7 @@ for their "hull" component: -background and -cursor. A derived
|
||||
class can override this decision, and add options that control
|
||||
the border of the "hull" component as well:
|
||||
.CS
|
||||
class MyWidget {
|
||||
itcl::class MyWidget {
|
||||
inherit Widget
|
||||
|
||||
constructor {args} {
|
||||
@@ -267,7 +265,7 @@ new value is reported to standard output. Note that this synthetic
|
||||
option is integrated with the rest of the "-background" options
|
||||
that have been kept from component widgets:
|
||||
.CS
|
||||
class MyWidget {
|
||||
itcl::class MyWidget {
|
||||
inherit Widget
|
||||
constructor {args} {
|
||||
itk_component add label {
|
||||
@@ -295,8 +293,8 @@ used to remove options at a later time. For example, a derived
|
||||
class can override an option defined in a base class by removing
|
||||
and redefining the option:
|
||||
.CS
|
||||
class Base {
|
||||
inherit Widget
|
||||
itcl::class Base {
|
||||
inherit itk::Widget
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
}
|
||||
@@ -306,7 +304,7 @@ class Base {
|
||||
}
|
||||
}
|
||||
|
||||
class Derived {
|
||||
itcl::class Derived {
|
||||
inherit Base
|
||||
|
||||
constructor {args} {
|
||||
|
||||
+2
-4
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: Toplevel.n,v 1.3 1998/08/11 14:40:53 welch Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Toplevel n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
@@ -68,7 +66,7 @@ user can dismiss by pushing the "Dismiss" button.
|
||||
.CS
|
||||
option add *MessageInfo.title "Notice" widgetDefault
|
||||
|
||||
class MessageInfo {
|
||||
itcl::class MessageInfo {
|
||||
inherit itk::Toplevel
|
||||
|
||||
constructor {args} {
|
||||
@@ -117,7 +115,7 @@ class MessageInfo {
|
||||
}
|
||||
}
|
||||
|
||||
usual MessageInfo {
|
||||
itk::usual MessageInfo {
|
||||
keep -background -cursor -foreground -font
|
||||
keep -activebackground -activeforeground -disabledforeground
|
||||
keep -highlightcolor -highlightthickness
|
||||
|
||||
+4
-6
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: Widget.n,v 1.1 1998/07/27 18:45:36 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH Widget n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
@@ -60,7 +58,7 @@ option add *TextDisplay.textBackground ivory widgetDefault
|
||||
option add *TextDisplay.width 40 widgetDefault
|
||||
option add *TextDisplay.height 10 widgetDefault
|
||||
|
||||
class TextDisplay {
|
||||
itcl::class TextDisplay {
|
||||
inherit itk::Widget
|
||||
|
||||
constructor {args} {
|
||||
@@ -87,20 +85,20 @@ class TextDisplay {
|
||||
public method append {info}
|
||||
}
|
||||
|
||||
body TextDisplay::display {info} {
|
||||
itcl::body TextDisplay::display {info} {
|
||||
$itk_component(text) configure -state normal
|
||||
$itk_component(text) delete 1.0 end
|
||||
$itk_component(text) insert 1.0 $info
|
||||
$itk_component(text) configure -state disabled
|
||||
}
|
||||
|
||||
body TextDisplay::append {info} {
|
||||
itcl::body TextDisplay::append {info} {
|
||||
$itk_component(text) configure -state normal
|
||||
$itk_component(text) insert end $info
|
||||
$itk_component(text) configure -state disabled
|
||||
}
|
||||
|
||||
usual TextDisplay {
|
||||
itk::usual TextDisplay {
|
||||
keep -background -cursor -foreground -font
|
||||
keep -activebackground -activerelief
|
||||
keep -highlightcolor -highlightthickness
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: itk.n,v 1.1 1998/07/27 18:45:36 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH itk n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: itkvars.n,v 1.1 1998/07/27 18:45:37 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH itkvars n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: itkwish.1,v 1.1 1998/07/27 18:45:37 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH itkwish 1 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
'\" Note: do not modify the .SH NAME line immediately below!
|
||||
.SH NAME
|
||||
itkwish \- Simple windowing shell for [incr\ Tcl] / [incr\ Tk]
|
||||
.SH SYNOPSIS
|
||||
\fBitkwish\fR ?\fIfileName arg arg ...\fR?
|
||||
.SH OPTIONS
|
||||
.IP "\fB\-display \fIdisplay\fR" 20
|
||||
Display (and screen) on which to display window.
|
||||
.IP "\fB\-geometry \fIgeometry\fR" 20
|
||||
Initial geometry to use for window. If this option is specified, its
|
||||
value is stored in the \fBgeometry\fR global variable of the application's
|
||||
Tcl interpreter.
|
||||
.IP "\fB\-name \fIname\fR" 20
|
||||
Use \fIname\fR as the title to be displayed in the window, and
|
||||
as the name of the interpreter for \fBsend\fR commands.
|
||||
.IP "\fB\-sync\fR" 20
|
||||
Execute all X server commands synchronously, so that errors
|
||||
are reported immediately. This will result in much slower
|
||||
execution, but it is useful for debugging.
|
||||
.IP "\fB\-\|\-\fR" 20
|
||||
Pass all remaining arguments through to the script's \fBargv\fR
|
||||
variable without interpreting them.
|
||||
This provides a mechanism for passing arguments such as \fB\-name\fR
|
||||
to a script instead of having \fBitkwish\fR interpret them.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBitkwish\fR is a simple program consisting of the Tcl command
|
||||
language, the Tk toolkit, the \fB[incr\ Tcl]\fR extension for
|
||||
object-oriented programming, and the \fB[incr\ Tk]\fR extension
|
||||
for building mega-widgets. The main program creates an
|
||||
interpreter, creates a main window, and then processes Tcl
|
||||
commands from standard input or from a file.
|
||||
.PP
|
||||
\fBitkwish\fR is just like \fBwish\fR, but includes the
|
||||
\fB[incr\ Tcl]\fR / \fB[incr\ Tk]\fR extensions.
|
||||
.PP
|
||||
See the \fBwish\fR man page for details concerning usage. See
|
||||
the \fBitcl\fR and \fBitk\fR man pages for an overview of
|
||||
\fB[incr\ Tcl]\fR / \fB[incr\ Tk]\fR.
|
||||
|
||||
.SH KEYWORDS
|
||||
Tcl, Tk, itcl, itk, interpreter, shell, toolkit
|
||||
+1
-3
@@ -4,8 +4,6 @@
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\" RCS: $Id: usual.n,v 1.1 1998/07/27 18:45:40 stanton Exp $
|
||||
'\"
|
||||
.so man.macros
|
||||
.TH usual n 3.0 itk "[incr\ Tk]"
|
||||
.BS
|
||||
@@ -61,7 +59,7 @@ all \fItag\fR names previously registered.
|
||||
Following is the \fBusual\fR declaration for the standard
|
||||
Tk button widget:
|
||||
.CS
|
||||
usual Button {
|
||||
itk::usual Button {
|
||||
keep -background -cursor -foreground -font
|
||||
keep -activebackground -activeforeground -disabledforeground
|
||||
keep -highlightcolor -highlightthickness
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
# itk.decls --
|
||||
#
|
||||
# This file contains the declarations for all supported public
|
||||
# functions that are exported by the Itk library via the stubs table.
|
||||
# This file is used to generate the itkDecls.h file.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
library itk
|
||||
interface itk
|
||||
|
||||
# Declare each of the functions in the public Itk interface. Note that
|
||||
# the an index should never be reused for a different function in order
|
||||
# to preserve backwards compatibility.
|
||||
|
||||
|
||||
#
|
||||
# Exported functions:
|
||||
#
|
||||
|
||||
declare 0 generic {
|
||||
int Itk_Init (Tcl_Interp *interp)
|
||||
}
|
||||
declare 1 generic {
|
||||
int Itk_SafeInit (Tcl_Interp *interp)
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Functions used internally by this package:
|
||||
#
|
||||
|
||||
declare 2 generic {
|
||||
int Itk_ConfigBodyCmd (ClientData cdata, Tcl_Interp *interp, \
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
}
|
||||
declare 3 generic {
|
||||
int Itk_UsualCmd (ClientData cdata, Tcl_Interp *interp, int objc, \
|
||||
Tcl_Obj *CONST objv[])
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Functions for managing options included in class definitions:
|
||||
#
|
||||
|
||||
declare 4 generic {
|
||||
int Itk_ClassOptionDefineCmd (ClientData cdata, Tcl_Interp *interp, \
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
}
|
||||
declare 5 generic {
|
||||
int Itk_ClassOptionIllegalCmd (ClientData cdata, Tcl_Interp *interp, \
|
||||
int objc, Tcl_Obj *CONST objv[])
|
||||
}
|
||||
declare 6 generic {
|
||||
int Itk_ConfigClassOption (Tcl_Interp *interp, ItclObject *contextObj, \
|
||||
ClientData cdata, CONST char* newVal)
|
||||
}
|
||||
declare 7 generic {
|
||||
ItkClassOptTable* Itk_CreateClassOptTable( Tcl_Interp *interp, \
|
||||
ItclClass *cdefn)
|
||||
}
|
||||
declare 8 generic {
|
||||
ItkClassOptTable* Itk_FindClassOptTable (ItclClass *cdefn)
|
||||
}
|
||||
#declare 9 generic {
|
||||
# void Itk_DeleteClassOptTable (Tcl_Interp *interp, ItclClass *cdefn)
|
||||
#}
|
||||
declare 10 generic {
|
||||
int Itk_CreateClassOption (Tcl_Interp *interp, ItclClass *cdefn, \
|
||||
char *switchName, char *resName, char *resClass, char *defVal, \
|
||||
char *config, ItkClassOption **optPtr)
|
||||
}
|
||||
declare 11 generic {
|
||||
ItkClassOption* Itk_FindClassOption (ItclClass *cdefn, char *switchName)
|
||||
}
|
||||
declare 12 generic {
|
||||
void Itk_DelClassOption (ItkClassOption *opt)
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Functions needed for the Archetype base class:
|
||||
#
|
||||
|
||||
declare 13 generic {
|
||||
int Itk_ArchetypeInit (Tcl_Interp* interp)
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Functions for maintaining the ordered option list:
|
||||
#
|
||||
|
||||
declare 14 generic {
|
||||
void Itk_OptListInit (ItkOptList* olist, Tcl_HashTable *options)
|
||||
}
|
||||
declare 15 generic {
|
||||
void Itk_OptListFree (ItkOptList* olist)
|
||||
}
|
||||
declare 16 generic {
|
||||
void Itk_OptListAdd (ItkOptList* olist, Tcl_HashEntry *entry)
|
||||
}
|
||||
declare 17 generic {
|
||||
void Itk_OptListRemove (ItkOptList* olist, Tcl_HashEntry *entry)
|
||||
}
|
||||
+45
-59
@@ -37,8 +37,6 @@
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
*
|
||||
* RCS: $Id: itk.h,v 1.4 1998/08/11 14:40:54 welch Exp $
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -48,6 +46,26 @@
|
||||
#ifndef ITK_H
|
||||
#define ITK_H
|
||||
|
||||
#ifndef TCL_ALPHA_RELEASE
|
||||
# define TCL_ALPHA_RELEASE 0
|
||||
#endif
|
||||
#ifndef TCL_BETA_RELEASE
|
||||
# define TCL_BETA_RELEASE 1
|
||||
#endif
|
||||
#ifndef TCL_FINAL_RELEASE
|
||||
# define TCL_FINAL_RELEASE 2
|
||||
#endif
|
||||
|
||||
|
||||
#define ITK_MAJOR_VERSION 3
|
||||
#define ITK_MINOR_VERSION 4
|
||||
#define ITK_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
#define ITK_RELEASE_SERIAL 2
|
||||
|
||||
#define ITK_VERSION "3.4"
|
||||
#define ITK_PATCH_LEVEL "3.4.2"
|
||||
|
||||
|
||||
/*
|
||||
* A special definition used to allow this header file to be included
|
||||
* in resource files so that they can get obtain version information from
|
||||
@@ -55,14 +73,20 @@
|
||||
* and procedure declarations, that occur below.
|
||||
*/
|
||||
|
||||
#ifndef RESOURCE_INCLUDED
|
||||
#ifndef RC_INVOKED
|
||||
|
||||
#include "itclInt.h"
|
||||
#include "tk.h"
|
||||
#include "itclInt.h"
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#ifdef BUILD_itk
|
||||
# undef TCL_STORAGE_CLASS
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
# define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#else
|
||||
# ifdef USE_ITK_STUBS
|
||||
# define TCL_STORAGE_CLASS
|
||||
# else
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -93,65 +117,27 @@ typedef struct ItkClassOption {
|
||||
char *init; /* initial value for option */
|
||||
} ItkClassOption;
|
||||
|
||||
#include "itkDecls.h"
|
||||
|
||||
/*
|
||||
* Exported functions:
|
||||
* This function is contained in the itkstub static library
|
||||
*/
|
||||
EXTERN int Itk_Init _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
EXTERN int Itk_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
|
||||
#ifdef USE_ITK_STUBS
|
||||
TCL_EXTERNC CONST char *
|
||||
Itk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
CONST char *version, int exact));
|
||||
#else
|
||||
#define Itk_InitStubs(interp, version, exact) \
|
||||
Tcl_PkgRequire(interp, "Itk", version, exact)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions used internally by this package:
|
||||
* Public functions that are not accessible via the stubs table.
|
||||
*/
|
||||
EXTERN int Itk_ConfigBodyCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
||||
EXTERN int Itk_UsualCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
||||
|
||||
/*
|
||||
* Functions for managing options included in class definitions:
|
||||
*/
|
||||
EXTERN int Itk_ClassOptionDefineCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
||||
EXTERN int Itk_ClassOptionIllegalCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
EXTERN int Itk_ConfigClassOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclObject *contextObj, ClientData cdata, char* newVal));
|
||||
|
||||
EXTERN ItkClassOptTable* Itk_CreateClassOptTable _ANSI_ARGS_((
|
||||
Tcl_Interp *interp, ItclClass *cdefn));
|
||||
EXTERN ItkClassOptTable* Itk_FindClassOptTable _ANSI_ARGS_((
|
||||
ItclClass *cdefn));
|
||||
EXTERN void Itk_DeleteClassOptTable _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclClass *cdefn));
|
||||
|
||||
EXTERN int Itk_CreateClassOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclClass *cdefn, char *switchName, char *resName, char *resClass,
|
||||
char *defVal, char *config, ItkClassOption **optPtr));
|
||||
EXTERN ItkClassOption* Itk_FindClassOption _ANSI_ARGS_((
|
||||
ItclClass *cdefn, char *switchName));
|
||||
EXTERN void Itk_DelClassOption _ANSI_ARGS_((ItkClassOption *opt));
|
||||
|
||||
/*
|
||||
* Functions needed for the Archetype base class:
|
||||
*/
|
||||
EXTERN int Itk_ArchetypeInit _ANSI_ARGS_((Tcl_Interp* interp));
|
||||
|
||||
/*
|
||||
* Functions for maintaining the ordered option list:
|
||||
*/
|
||||
EXTERN void Itk_OptListInit _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashTable *options));
|
||||
EXTERN void Itk_OptListFree _ANSI_ARGS_((ItkOptList* olist));
|
||||
|
||||
EXTERN void Itk_OptListAdd _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashEntry *entry));
|
||||
EXTERN void Itk_OptListRemove _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashEntry *entry));
|
||||
|
||||
# undef TCL_STORAGE_CLASS
|
||||
# define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* RESOURCE INCLUDED */
|
||||
#endif /* RC_INVOKED */
|
||||
#endif /* ITK_H */
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* itkDecls.h --
|
||||
*
|
||||
* Declarations of functions in the platform independent public Itk API.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#ifndef _ITKDECLS
|
||||
#define _ITKDECLS
|
||||
|
||||
#ifdef BUILD_itk
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLEXPORT
|
||||
#endif
|
||||
|
||||
/*
|
||||
* WARNING: This file is automatically generated by the tools/genStubs.tcl
|
||||
* script. Any modifications to the function declarations below should be made
|
||||
* in the generic/tk.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
/*
|
||||
* Exported function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itk_Init_TCL_DECLARED
|
||||
#define Itk_Init_TCL_DECLARED
|
||||
/* 0 */
|
||||
TCL_EXTERN(int) Itk_Init _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itk_SafeInit_TCL_DECLARED
|
||||
#define Itk_SafeInit_TCL_DECLARED
|
||||
/* 1 */
|
||||
TCL_EXTERN(int) Itk_SafeInit _ANSI_ARGS_((Tcl_Interp * interp));
|
||||
#endif
|
||||
#ifndef Itk_ConfigBodyCmd_TCL_DECLARED
|
||||
#define Itk_ConfigBodyCmd_TCL_DECLARED
|
||||
/* 2 */
|
||||
TCL_EXTERN(int) Itk_ConfigBodyCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp * interp, int objc,
|
||||
Tcl_Obj *CONST objv[]));
|
||||
#endif
|
||||
#ifndef Itk_UsualCmd_TCL_DECLARED
|
||||
#define Itk_UsualCmd_TCL_DECLARED
|
||||
/* 3 */
|
||||
TCL_EXTERN(int) Itk_UsualCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp * interp, int objc,
|
||||
Tcl_Obj *CONST objv[]));
|
||||
#endif
|
||||
#ifndef Itk_ClassOptionDefineCmd_TCL_DECLARED
|
||||
#define Itk_ClassOptionDefineCmd_TCL_DECLARED
|
||||
/* 4 */
|
||||
TCL_EXTERN(int) Itk_ClassOptionDefineCmd _ANSI_ARGS_((
|
||||
ClientData cdata, Tcl_Interp * interp,
|
||||
int objc, Tcl_Obj *CONST objv[]));
|
||||
#endif
|
||||
#ifndef Itk_ClassOptionIllegalCmd_TCL_DECLARED
|
||||
#define Itk_ClassOptionIllegalCmd_TCL_DECLARED
|
||||
/* 5 */
|
||||
TCL_EXTERN(int) Itk_ClassOptionIllegalCmd _ANSI_ARGS_((
|
||||
ClientData cdata, Tcl_Interp * interp,
|
||||
int objc, Tcl_Obj *CONST objv[]));
|
||||
#endif
|
||||
#ifndef Itk_ConfigClassOption_TCL_DECLARED
|
||||
#define Itk_ConfigClassOption_TCL_DECLARED
|
||||
/* 6 */
|
||||
TCL_EXTERN(int) Itk_ConfigClassOption _ANSI_ARGS_((
|
||||
Tcl_Interp * interp, ItclObject * contextObj,
|
||||
ClientData cdata, CONST char* newVal));
|
||||
#endif
|
||||
#ifndef Itk_CreateClassOptTable_TCL_DECLARED
|
||||
#define Itk_CreateClassOptTable_TCL_DECLARED
|
||||
/* 7 */
|
||||
TCL_EXTERN(ItkClassOptTable*) Itk_CreateClassOptTable _ANSI_ARGS_((
|
||||
Tcl_Interp * interp, ItclClass * cdefn));
|
||||
#endif
|
||||
#ifndef Itk_FindClassOptTable_TCL_DECLARED
|
||||
#define Itk_FindClassOptTable_TCL_DECLARED
|
||||
/* 8 */
|
||||
TCL_EXTERN(ItkClassOptTable*) Itk_FindClassOptTable _ANSI_ARGS_((
|
||||
ItclClass * cdefn));
|
||||
#endif
|
||||
/* Slot 9 is reserved */
|
||||
#ifndef Itk_CreateClassOption_TCL_DECLARED
|
||||
#define Itk_CreateClassOption_TCL_DECLARED
|
||||
/* 10 */
|
||||
TCL_EXTERN(int) Itk_CreateClassOption _ANSI_ARGS_((
|
||||
Tcl_Interp * interp, ItclClass * cdefn,
|
||||
char * switchName, char * resName,
|
||||
char * resClass, char * defVal,
|
||||
char * config, ItkClassOption ** optPtr));
|
||||
#endif
|
||||
#ifndef Itk_FindClassOption_TCL_DECLARED
|
||||
#define Itk_FindClassOption_TCL_DECLARED
|
||||
/* 11 */
|
||||
TCL_EXTERN(ItkClassOption*) Itk_FindClassOption _ANSI_ARGS_((
|
||||
ItclClass * cdefn, char * switchName));
|
||||
#endif
|
||||
#ifndef Itk_DelClassOption_TCL_DECLARED
|
||||
#define Itk_DelClassOption_TCL_DECLARED
|
||||
/* 12 */
|
||||
TCL_EXTERN(void) Itk_DelClassOption _ANSI_ARGS_((ItkClassOption * opt));
|
||||
#endif
|
||||
#ifndef Itk_ArchetypeInit_TCL_DECLARED
|
||||
#define Itk_ArchetypeInit_TCL_DECLARED
|
||||
/* 13 */
|
||||
TCL_EXTERN(int) Itk_ArchetypeInit _ANSI_ARGS_((Tcl_Interp* interp));
|
||||
#endif
|
||||
#ifndef Itk_OptListInit_TCL_DECLARED
|
||||
#define Itk_OptListInit_TCL_DECLARED
|
||||
/* 14 */
|
||||
TCL_EXTERN(void) Itk_OptListInit _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashTable * options));
|
||||
#endif
|
||||
#ifndef Itk_OptListFree_TCL_DECLARED
|
||||
#define Itk_OptListFree_TCL_DECLARED
|
||||
/* 15 */
|
||||
TCL_EXTERN(void) Itk_OptListFree _ANSI_ARGS_((ItkOptList* olist));
|
||||
#endif
|
||||
#ifndef Itk_OptListAdd_TCL_DECLARED
|
||||
#define Itk_OptListAdd_TCL_DECLARED
|
||||
/* 16 */
|
||||
TCL_EXTERN(void) Itk_OptListAdd _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashEntry * entry));
|
||||
#endif
|
||||
#ifndef Itk_OptListRemove_TCL_DECLARED
|
||||
#define Itk_OptListRemove_TCL_DECLARED
|
||||
/* 17 */
|
||||
TCL_EXTERN(void) Itk_OptListRemove _ANSI_ARGS_((ItkOptList* olist,
|
||||
Tcl_HashEntry * entry));
|
||||
#endif
|
||||
|
||||
typedef struct ItkStubs {
|
||||
int magic;
|
||||
struct ItkStubHooks *hooks;
|
||||
|
||||
int (*itk_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */
|
||||
int (*itk_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */
|
||||
int (*itk_ConfigBodyCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 2 */
|
||||
int (*itk_UsualCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 3 */
|
||||
int (*itk_ClassOptionDefineCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 4 */
|
||||
int (*itk_ClassOptionIllegalCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 5 */
|
||||
int (*itk_ConfigClassOption) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, ClientData cdata, CONST char* newVal)); /* 6 */
|
||||
ItkClassOptTable* (*itk_CreateClassOptTable) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn)); /* 7 */
|
||||
ItkClassOptTable* (*itk_FindClassOptTable) _ANSI_ARGS_((ItclClass * cdefn)); /* 8 */
|
||||
void *reserved9;
|
||||
int (*itk_CreateClassOption) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn, char * switchName, char * resName, char * resClass, char * defVal, char * config, ItkClassOption ** optPtr)); /* 10 */
|
||||
ItkClassOption* (*itk_FindClassOption) _ANSI_ARGS_((ItclClass * cdefn, char * switchName)); /* 11 */
|
||||
void (*itk_DelClassOption) _ANSI_ARGS_((ItkClassOption * opt)); /* 12 */
|
||||
int (*itk_ArchetypeInit) _ANSI_ARGS_((Tcl_Interp* interp)); /* 13 */
|
||||
void (*itk_OptListInit) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashTable * options)); /* 14 */
|
||||
void (*itk_OptListFree) _ANSI_ARGS_((ItkOptList* olist)); /* 15 */
|
||||
void (*itk_OptListAdd) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashEntry * entry)); /* 16 */
|
||||
void (*itk_OptListRemove) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashEntry * entry)); /* 17 */
|
||||
} ItkStubs;
|
||||
|
||||
TCL_EXTERNC ItkStubs *itkStubsPtr;
|
||||
|
||||
#if defined(USE_ITK_STUBS) && !defined(USE_ITK_STUB_PROCS)
|
||||
|
||||
/*
|
||||
* Inline function declarations:
|
||||
*/
|
||||
|
||||
#ifndef Itk_Init
|
||||
#define Itk_Init \
|
||||
(itkStubsPtr->itk_Init) /* 0 */
|
||||
#endif
|
||||
#ifndef Itk_SafeInit
|
||||
#define Itk_SafeInit \
|
||||
(itkStubsPtr->itk_SafeInit) /* 1 */
|
||||
#endif
|
||||
#ifndef Itk_ConfigBodyCmd
|
||||
#define Itk_ConfigBodyCmd \
|
||||
(itkStubsPtr->itk_ConfigBodyCmd) /* 2 */
|
||||
#endif
|
||||
#ifndef Itk_UsualCmd
|
||||
#define Itk_UsualCmd \
|
||||
(itkStubsPtr->itk_UsualCmd) /* 3 */
|
||||
#endif
|
||||
#ifndef Itk_ClassOptionDefineCmd
|
||||
#define Itk_ClassOptionDefineCmd \
|
||||
(itkStubsPtr->itk_ClassOptionDefineCmd) /* 4 */
|
||||
#endif
|
||||
#ifndef Itk_ClassOptionIllegalCmd
|
||||
#define Itk_ClassOptionIllegalCmd \
|
||||
(itkStubsPtr->itk_ClassOptionIllegalCmd) /* 5 */
|
||||
#endif
|
||||
#ifndef Itk_ConfigClassOption
|
||||
#define Itk_ConfigClassOption \
|
||||
(itkStubsPtr->itk_ConfigClassOption) /* 6 */
|
||||
#endif
|
||||
#ifndef Itk_CreateClassOptTable
|
||||
#define Itk_CreateClassOptTable \
|
||||
(itkStubsPtr->itk_CreateClassOptTable) /* 7 */
|
||||
#endif
|
||||
#ifndef Itk_FindClassOptTable
|
||||
#define Itk_FindClassOptTable \
|
||||
(itkStubsPtr->itk_FindClassOptTable) /* 8 */
|
||||
#endif
|
||||
/* Slot 9 is reserved */
|
||||
#ifndef Itk_CreateClassOption
|
||||
#define Itk_CreateClassOption \
|
||||
(itkStubsPtr->itk_CreateClassOption) /* 10 */
|
||||
#endif
|
||||
#ifndef Itk_FindClassOption
|
||||
#define Itk_FindClassOption \
|
||||
(itkStubsPtr->itk_FindClassOption) /* 11 */
|
||||
#endif
|
||||
#ifndef Itk_DelClassOption
|
||||
#define Itk_DelClassOption \
|
||||
(itkStubsPtr->itk_DelClassOption) /* 12 */
|
||||
#endif
|
||||
#ifndef Itk_ArchetypeInit
|
||||
#define Itk_ArchetypeInit \
|
||||
(itkStubsPtr->itk_ArchetypeInit) /* 13 */
|
||||
#endif
|
||||
#ifndef Itk_OptListInit
|
||||
#define Itk_OptListInit \
|
||||
(itkStubsPtr->itk_OptListInit) /* 14 */
|
||||
#endif
|
||||
#ifndef Itk_OptListFree
|
||||
#define Itk_OptListFree \
|
||||
(itkStubsPtr->itk_OptListFree) /* 15 */
|
||||
#endif
|
||||
#ifndef Itk_OptListAdd
|
||||
#define Itk_OptListAdd \
|
||||
(itkStubsPtr->itk_OptListAdd) /* 16 */
|
||||
#endif
|
||||
#ifndef Itk_OptListRemove
|
||||
#define Itk_OptListRemove \
|
||||
(itkStubsPtr->itk_OptListRemove) /* 17 */
|
||||
#endif
|
||||
|
||||
#endif /* defined(USE_ITK_STUBS) && !defined(USE_ITK_STUB_PROCS) */
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
|
||||
#undef TCL_STORAGE_CLASS
|
||||
#define TCL_STORAGE_CLASS DLLIMPORT
|
||||
|
||||
#endif /* _ITKDECLS */
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* tkStubInit.c --
|
||||
*
|
||||
* This file contains the initializers for the Itk stub vectors.
|
||||
*
|
||||
* Copyright (c) 1998-1999 by XXXX
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "itk.h"
|
||||
|
||||
/*
|
||||
* Remove macros that will interfere with the definitions below.
|
||||
*/
|
||||
|
||||
/*
|
||||
* WARNING: The contents of this file is automatically generated by the
|
||||
* tools/genStubs.tcl script. Any modifications to the function declarations
|
||||
* below should be made in the generic/itk.decls script.
|
||||
*/
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
ItkStubs itkStubs = {
|
||||
TCL_STUB_MAGIC,
|
||||
NULL,
|
||||
Itk_Init, /* 0 */
|
||||
Itk_SafeInit, /* 1 */
|
||||
Itk_ConfigBodyCmd, /* 2 */
|
||||
Itk_UsualCmd, /* 3 */
|
||||
Itk_ClassOptionDefineCmd, /* 4 */
|
||||
Itk_ClassOptionIllegalCmd, /* 5 */
|
||||
Itk_ConfigClassOption, /* 6 */
|
||||
Itk_CreateClassOptTable, /* 7 */
|
||||
Itk_FindClassOptTable, /* 8 */
|
||||
NULL, /* 9 */
|
||||
Itk_CreateClassOption, /* 10 */
|
||||
Itk_FindClassOption, /* 11 */
|
||||
Itk_DelClassOption, /* 12 */
|
||||
Itk_ArchetypeInit, /* 13 */
|
||||
Itk_OptListInit, /* 14 */
|
||||
Itk_OptListFree, /* 15 */
|
||||
Itk_OptListAdd, /* 16 */
|
||||
Itk_OptListRemove, /* 17 */
|
||||
};
|
||||
|
||||
/* !END!: Do not edit above this line. */
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* itkStubLib.c --
|
||||
*
|
||||
* Stub object that will be statically linked into extensions that wish
|
||||
* to access Itk.
|
||||
*
|
||||
* Copyright (c) 1998-1999 by XXXX
|
||||
* Copyright (c) 1998 Paul Duffin.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
/*
|
||||
* We need to ensure that we use the stub macros so that this file contains
|
||||
* no references to any of the stub functions. This will make it possible
|
||||
* to build an extension that references Tcl_InitStubs but doesn't end up
|
||||
* including the rest of the stub functions.
|
||||
*/
|
||||
|
||||
#ifndef USE_TCL_STUBS
|
||||
#define USE_TCL_STUBS
|
||||
#endif
|
||||
#undef USE_TCL_STUB_PROCS
|
||||
|
||||
#ifndef USE_ITK_STUBS
|
||||
#define USE_ITK_STUBS
|
||||
#endif
|
||||
#undef USE_ITK_STUB_PROCS
|
||||
|
||||
#include "itk.h"
|
||||
|
||||
ItkStubs *itkStubsPtr;
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Itk_InitStubs --
|
||||
*
|
||||
* Tries to initialise the stub table pointers and ensures that
|
||||
* the correct version of Itk is loaded.
|
||||
*
|
||||
* Results:
|
||||
* The actual version of Itk that satisfies the request, or
|
||||
* NULL to indicate that an error occurred.
|
||||
*
|
||||
* Side effects:
|
||||
* Sets the stub table pointers.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
CONST char *
|
||||
Itk_InitStubs (interp, version, exact)
|
||||
Tcl_Interp *interp;
|
||||
CONST char *version;
|
||||
int exact;
|
||||
{
|
||||
CONST char *actualVersion;
|
||||
|
||||
actualVersion = Tcl_PkgRequireEx(interp, "Itk", (CONST84 char *)version, exact,
|
||||
(ClientData *) &itkStubsPtr);
|
||||
|
||||
if (actualVersion == NULL) {
|
||||
itkStubsPtr = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return actualVersion;
|
||||
}
|
||||
+199
-109
@@ -25,8 +25,6 @@
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
*
|
||||
* RCS: $Id: itk_archetype.c,v 1.1 1998/07/27 18:45:23 stanton Exp $
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -54,6 +52,11 @@ typedef struct ArchComponent {
|
||||
ItclMember *member; /* contains protection level for this comp */
|
||||
Tcl_Command accessCmd; /* access command for component widget */
|
||||
Tk_Window tkwin; /* Tk window for this component widget */
|
||||
char *pathName; /* Tk path name for this component widget.
|
||||
We can't use the tkwin pointer after
|
||||
the window has been destroyed so we
|
||||
need to save a copy for use in
|
||||
Itk_ArchCompDeleteCmd() */
|
||||
} ArchComponent;
|
||||
|
||||
/*
|
||||
@@ -77,7 +80,7 @@ typedef struct ArchOption {
|
||||
* Various parts of a composite option in an Archetype mega-widget:
|
||||
*/
|
||||
typedef int (Itk_ConfigOptionPartProc) _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclObject *contextObj, ClientData cdata, char* newVal));
|
||||
ItclObject *contextObj, ClientData cdata, CONST char* newVal));
|
||||
|
||||
typedef struct ArchOptionPart {
|
||||
ClientData clientData; /* data associated with this part */
|
||||
@@ -169,12 +172,12 @@ static int Itk_ArchConfigureCmd _ANSI_ARGS_((ClientData cdata,
|
||||
static int Itk_ArchCgetCmd _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
|
||||
static int Itk_PropagateOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclObject *contextObj, ClientData cdata, char *newval));
|
||||
ItclObject *contextObj, ClientData cdata, CONST char *newval));
|
||||
static int Itk_PropagatePublicVar _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ItclObject *contextObj, ClientData cdata, char *newval));
|
||||
ItclObject *contextObj, ClientData cdata, CONST char *newval));
|
||||
|
||||
static int Itk_ArchSetOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ArchInfo *info, char *name, char *value));
|
||||
ArchInfo *info, CONST char *name, CONST char *value));
|
||||
static int Itk_ArchConfigOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ArchInfo *info, char *name, char *value));
|
||||
static void Itk_ArchOptConfigError _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
@@ -192,9 +195,9 @@ static void Itk_DelArchComponent _ANSI_ARGS_((ArchComponent *archComp));
|
||||
|
||||
static int Itk_GetArchOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ArchInfo *info, char *switchName, char *resName, char *resClass,
|
||||
char *defVal, char *currVal, ArchOption **aoPtr));
|
||||
CONST char *defVal, char *currVal, ArchOption **aoPtr));
|
||||
static void Itk_InitArchOption _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ArchInfo *info, ArchOption *archOpt, char *defVal,
|
||||
ArchInfo *info, ArchOption *archOpt, CONST char *defVal,
|
||||
char *currVal));
|
||||
static void Itk_DelArchOption _ANSI_ARGS_((ArchOption *archOpt));
|
||||
|
||||
@@ -203,7 +206,7 @@ static ArchOptionPart* Itk_CreateOptionPart _ANSI_ARGS_((
|
||||
Tcl_CmdDeleteProc *dproc, ClientData from));
|
||||
static int Itk_AddOptionPart _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
ArchInfo *info, char *switchName, char *resName, char *resClass,
|
||||
char *defVal, char *currVal, ArchOptionPart *optPart,
|
||||
CONST char *defVal, char *currVal, ArchOptionPart *optPart,
|
||||
ArchOption **raOpt));
|
||||
static ArchOptionPart* Itk_FindArchOptionPart _ANSI_ARGS_((
|
||||
ArchInfo *info, char *switchName, ClientData from));
|
||||
@@ -404,7 +407,7 @@ Itk_ArchInitOptsCmd(dummy, interp, objc, objv)
|
||||
|
||||
char *token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot use \"", token, "\" without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -542,7 +545,7 @@ Itk_ArchDeleteOptsCmd(dummy, interp, objc, objv)
|
||||
|
||||
char *token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot use \"", token, "\" without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -594,7 +597,7 @@ Itk_ArchComponentCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
if (objc < 2) {
|
||||
cmd = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"wrong # args: should be one of...\n",
|
||||
" ", cmd, " add ?-protected? ?-private? ?--? name createCmds ?optionCmds?\n",
|
||||
" ", cmd, " delete name ?name name...?",
|
||||
@@ -633,7 +636,7 @@ Itk_ArchComponentCmd(dummy, interp, objc, objv)
|
||||
* Flag any errors.
|
||||
*/
|
||||
cmd = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option \"", token,
|
||||
"\": should be one of...\n",
|
||||
" ", cmd, " add name createCmds ?optionCmds?\n",
|
||||
@@ -676,12 +679,13 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
int pLevel = ITCL_PUBLIC;
|
||||
|
||||
int newEntry, result;
|
||||
char *cmd, *token, *name, *resultStr;
|
||||
CONST char *cmd, *token, *resultStr;
|
||||
char *name;
|
||||
Tcl_Namespace *parserNs;
|
||||
ItclClass *contextClass, *ownerClass;
|
||||
ItclObject *contextObj;
|
||||
ArchInfo *info;
|
||||
Tcl_CallFrame frame, *uplevelFramePtr, *oldFramePtr;
|
||||
Itcl_CallFrame frame, *uplevelFramePtr, *oldFramePtr;
|
||||
Tcl_Command accessCmd;
|
||||
Tcl_Obj *objPtr;
|
||||
Tcl_DString buffer;
|
||||
@@ -693,7 +697,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
!contextObj) {
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot access components without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -725,7 +729,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option \"", token,
|
||||
"\": should be -private, -protected or --",
|
||||
(char*)NULL);
|
||||
@@ -736,7 +740,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
if (objc < 3 || objc > 4) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"wrong # args: should be \"", cmd,
|
||||
" ?-protected? ?-private? ?--? name createCmds ?optionCmds?",
|
||||
(char*)NULL);
|
||||
@@ -749,7 +753,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
name = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
entry = Tcl_CreateHashEntry(&info->components, name, &newEntry);
|
||||
if (!newEntry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"component \"", name, "\" already defined",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -812,7 +816,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
|
||||
if (!accessCmd) {
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot find component access command \"",
|
||||
path, "\" for component \"", name, "\"",
|
||||
(char*)NULL);
|
||||
@@ -975,7 +979,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
objPtr = objv[3];
|
||||
}
|
||||
|
||||
result = Tcl_PushCallFrame(interp, &frame,
|
||||
result = Tcl_PushCallFrame(interp, (Tcl_CallFrame *) &frame,
|
||||
parserNs, /* isProcCallFrame */ 0);
|
||||
|
||||
if (result == TCL_OK) {
|
||||
@@ -983,7 +987,7 @@ Itk_ArchCompAddCmd(dummy, interp, objc, objv)
|
||||
Tcl_PopCallFrame(interp);
|
||||
}
|
||||
|
||||
if (objPtr != objv[3]) {
|
||||
if (objc != 4) {
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
}
|
||||
if (result != TCL_OK) {
|
||||
@@ -1100,6 +1104,8 @@ Itk_ArchCompDeleteCmd(dummy, interp, objc, objv)
|
||||
ArchComponent *archComp;
|
||||
ArchOption *archOpt;
|
||||
ArchOptionPart *optPart;
|
||||
Itcl_List delOptList;
|
||||
Tcl_DString buffer;
|
||||
|
||||
/*
|
||||
* Get the Archetype info associated with this widget.
|
||||
@@ -1108,7 +1114,7 @@ Itk_ArchCompDeleteCmd(dummy, interp, objc, objv)
|
||||
!contextObj) {
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot access components without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1125,14 +1131,37 @@ Itk_ArchCompDeleteCmd(dummy, interp, objc, objv)
|
||||
token = Tcl_GetStringFromObj(objv[i], (int*)NULL);
|
||||
entry = Tcl_FindHashEntry(&info->components, token);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"name \"", token, "\" is not a component",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
archComp = (ArchComponent*)Tcl_GetHashValue(entry);
|
||||
|
||||
/*
|
||||
* Clean up the binding tag that causes the widget to
|
||||
* call this method automatically when destroyed.
|
||||
* Ignore errors if anything goes wrong.
|
||||
*/
|
||||
Tcl_DStringInit(&buffer);
|
||||
Tcl_DStringAppend(&buffer, "itk::remove_destroy_hook ", -1);
|
||||
Tcl_DStringAppend(&buffer, archComp->pathName, -1);
|
||||
(void) Tcl_Eval(interp, Tcl_DStringValue(&buffer));
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_DStringFree(&buffer);
|
||||
|
||||
Tcl_UnsetVar2(interp, "itk_component", token, 0);
|
||||
Tcl_DeleteHashEntry(entry);
|
||||
|
||||
/*
|
||||
* Clean up the options that belong to the component. Do this
|
||||
* by scanning through all available options and looking for
|
||||
* those that belong to the component. If we remove them as
|
||||
* we go, we'll mess up Tcl_NextHashEntry. So instead, we
|
||||
* build up a list of options to remove, and then remove the
|
||||
* options below.
|
||||
*/
|
||||
Itcl_InitList(&delOptList);
|
||||
entry = Tcl_FirstHashEntry(&info->options, &place);
|
||||
while (entry) {
|
||||
archOpt = (ArchOption*)Tcl_GetHashValue(entry);
|
||||
@@ -1140,16 +1169,28 @@ Itk_ArchCompDeleteCmd(dummy, interp, objc, objv)
|
||||
while (elem) {
|
||||
optPart = (ArchOptionPart*)Itcl_GetListValue(elem);
|
||||
if (optPart->from == (ClientData)archComp) {
|
||||
Itk_DelOptionPart(optPart);
|
||||
elem = Itcl_DeleteListElem(elem);
|
||||
}
|
||||
else {
|
||||
elem = Itcl_NextListElem(elem);
|
||||
Itcl_AppendList(&delOptList, (ClientData)entry);
|
||||
}
|
||||
elem = Itcl_NextListElem(elem);
|
||||
}
|
||||
entry = Tcl_NextHashEntry(&place);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we've figured out which options to delete,
|
||||
* go through the list and remove them.
|
||||
*/
|
||||
elem = Itcl_FirstListElem(&delOptList);
|
||||
while (elem) {
|
||||
entry = (Tcl_HashEntry*)Itcl_GetListValue(elem);
|
||||
token = Tcl_GetHashKey(&info->options, entry);
|
||||
|
||||
Itk_RemoveArchOptionPart(info, token, (ClientData)archComp);
|
||||
|
||||
elem = Itcl_NextListElem(elem);
|
||||
}
|
||||
Itcl_DeleteList(&delOptList);
|
||||
|
||||
Itk_DelArchComponent(archComp);
|
||||
}
|
||||
return TCL_OK;
|
||||
@@ -1203,7 +1244,7 @@ Itk_ArchOptKeepCmd(clientData, interp, objc, objv)
|
||||
*/
|
||||
if (!mergeInfo->archInfo || !mergeInfo->optionTable) {
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: \"", token,
|
||||
"\" should only be accessed via itk_component",
|
||||
(char*)NULL);
|
||||
@@ -1219,7 +1260,7 @@ Itk_ArchOptKeepCmd(clientData, interp, objc, objv)
|
||||
token = Tcl_GetStringFromObj(objv[i], (int*)NULL);
|
||||
entry = Tcl_FindHashEntry(mergeInfo->optionTable, token);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"option not recognized: ", token,
|
||||
(char*)NULL);
|
||||
result = TCL_ERROR;
|
||||
@@ -1304,7 +1345,7 @@ Itk_ArchOptIgnoreCmd(clientData, interp, objc, objv)
|
||||
*/
|
||||
if (!mergeInfo->archInfo || !mergeInfo->optionTable) {
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: \"", token,
|
||||
"\" should only be accessed via itk_component",
|
||||
(char*)NULL);
|
||||
@@ -1382,7 +1423,7 @@ Itk_ArchOptRenameCmd(clientData, interp, objc, objv)
|
||||
*/
|
||||
if (!mergeInfo->archInfo || !mergeInfo->optionTable) {
|
||||
char *token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: \"", token,
|
||||
"\" should only be accessed via itk_component",
|
||||
(char*)NULL);
|
||||
@@ -1398,14 +1439,14 @@ Itk_ArchOptRenameCmd(clientData, interp, objc, objv)
|
||||
* Make sure that the resource name and resource class look good.
|
||||
*/
|
||||
if (!islower((int)*resName)) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource name \"", resName,
|
||||
"\": should start with a lower case letter",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (!isupper((int)*resClass)) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource class \"", resClass,
|
||||
"\": should start with an upper case letter",
|
||||
(char*)NULL);
|
||||
@@ -1417,7 +1458,7 @@ Itk_ArchOptRenameCmd(clientData, interp, objc, objv)
|
||||
*/
|
||||
entry = Tcl_FindHashEntry(mergeInfo->optionTable, oldSwitch);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"option not recognized: ", oldSwitch,
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1490,7 +1531,7 @@ Itk_ArchOptUsualCmd(clientData, interp, objc, objv)
|
||||
{
|
||||
ArchMergeInfo *mergeInfo = (ArchMergeInfo*)clientData;
|
||||
|
||||
char *tag;
|
||||
CONST char *tag;
|
||||
Tcl_HashEntry *entry;
|
||||
Tcl_Obj *codePtr;
|
||||
|
||||
@@ -1506,7 +1547,7 @@ Itk_ArchOptUsualCmd(clientData, interp, objc, objv)
|
||||
*/
|
||||
if (!mergeInfo->archInfo || !mergeInfo->optionTable) {
|
||||
char *token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: \"", token,
|
||||
"\" should only be accessed via itk_component",
|
||||
(char*)NULL);
|
||||
@@ -1534,7 +1575,7 @@ Itk_ArchOptUsualCmd(clientData, interp, objc, objv)
|
||||
return Tcl_EvalObj(interp, codePtr);
|
||||
}
|
||||
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"can't find usual code for tag \"", tag, "\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -1661,8 +1702,9 @@ Itk_ArchInitCmd(dummy, interp, objc, objv)
|
||||
ArchInfo *info;
|
||||
|
||||
int i, result;
|
||||
char *token, *val;
|
||||
Tcl_CallFrame *framePtr;
|
||||
CONST char *val;
|
||||
char *token;
|
||||
Itcl_CallFrame *framePtr;
|
||||
ItkClassOption *opt;
|
||||
ItkClassOptTable *optTable;
|
||||
Itcl_ListElem *part;
|
||||
@@ -1678,7 +1720,7 @@ Itk_ArchInitCmd(dummy, interp, objc, objv)
|
||||
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: should be \"object ",
|
||||
token, " ?-option value -option value...?\"",
|
||||
(char*)NULL);
|
||||
@@ -1704,11 +1746,24 @@ Itk_ArchInitCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
Itcl_InitHierIter(&hier, contextClass);
|
||||
while ((cdefn=Itcl_AdvanceHierIter(&hier)) != NULL) {
|
||||
entry = Tcl_FirstHashEntry(&cdefn->variables, &place);
|
||||
while (entry) {
|
||||
|
||||
for (entry = Tcl_FirstHashEntry(&cdefn->variables, &place);
|
||||
entry; entry = Tcl_NextHashEntry(&place)) {
|
||||
Var *arrayPtr, *varPtr = NULL;
|
||||
|
||||
vdefn = (ItclVarDefn*)Tcl_GetHashValue(entry);
|
||||
|
||||
if (vdefn->member->protection == ITCL_PUBLIC) {
|
||||
if (vdefn->member->protection != ITCL_PUBLIC) {
|
||||
continue;
|
||||
}
|
||||
|
||||
varPtr = TclLookupVar(interp, vdefn->member->fullname, NULL, 0,
|
||||
NULL, 0, 0, &arrayPtr);
|
||||
|
||||
if (varPtr && TclIsVarArray(varPtr)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
optPart = Itk_FindArchOptionPart(info,
|
||||
vdefn->member->name, (ClientData)vdefn);
|
||||
|
||||
@@ -1729,8 +1784,6 @@ Itk_ArchInitCmd(dummy, interp, objc, objv)
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
entry = Tcl_NextHashEntry(&place);
|
||||
}
|
||||
}
|
||||
Itcl_DeleteHierIter(&hier);
|
||||
@@ -1770,16 +1823,22 @@ Itk_ArchInitCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
if (objc > 1) {
|
||||
for (objc--,objv++; objc > 0; objc-=2, objv+=2) {
|
||||
char *value;
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
if (objc < 2) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
/* Bug 227814
|
||||
* Ensure that the interp result is unshared.
|
||||
*/
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendResult(interp,
|
||||
"value for \"", token, "\" missing",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
val = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
if (Itk_ArchConfigOption(interp, info, token, val) != TCL_OK) {
|
||||
value = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
if (Itk_ArchConfigOption(interp, info, token, value) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -1862,7 +1921,7 @@ Itk_ArchOptionCmd(dummy, interp, objc, objv)
|
||||
*/
|
||||
if (objc < 2) {
|
||||
cmd = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"wrong # args: should be one of...\n",
|
||||
" ", cmd, " add name ?name name...?\n",
|
||||
" ", cmd, " define -switch resourceName resourceClass init ?config?\n",
|
||||
@@ -1901,7 +1960,7 @@ Itk_ArchOptionCmd(dummy, interp, objc, objv)
|
||||
* Handle: itk_option define...
|
||||
*/
|
||||
else if (c == 'd' && strncmp(token, "define", length) == 0) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"can only ", token, " options at the class level\n",
|
||||
"(move this command into the class definition)",
|
||||
(char*)NULL);
|
||||
@@ -1912,7 +1971,7 @@ Itk_ArchOptionCmd(dummy, interp, objc, objv)
|
||||
* Flag any errors.
|
||||
*/
|
||||
cmd = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option \"", token,
|
||||
"\": should be one of...\n",
|
||||
" ", cmd, " add name ?name name...?\n",
|
||||
@@ -1972,7 +2031,7 @@ Itk_ArchOptionAddCmd(dummy, interp, objc, objv)
|
||||
!contextObj) {
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot access options without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2002,7 +2061,7 @@ Itk_ArchOptionAddCmd(dummy, interp, objc, objv)
|
||||
|
||||
opt = Itk_FindClassOption(cdefn, tail);
|
||||
if (!opt) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"option \"", tail, "\" not defined in class \"",
|
||||
cdefn->fullname, "\"",
|
||||
(char*)NULL);
|
||||
@@ -2046,7 +2105,7 @@ Itk_ArchOptionAddCmd(dummy, interp, objc, objv)
|
||||
|
||||
entry = Tcl_FindHashEntry(&info->components, head);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"name \"", head, "\" is not a component",
|
||||
(char*)NULL);
|
||||
*sep = tmp;
|
||||
@@ -2091,7 +2150,7 @@ Itk_ArchOptionAddCmd(dummy, interp, objc, objv)
|
||||
/*
|
||||
* Anything else is an error.
|
||||
*/
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option \"", token, "\": should be one of...\n",
|
||||
" class::option\n",
|
||||
" component.option",
|
||||
@@ -2149,7 +2208,7 @@ Itk_ArchOptionRemoveCmd(dummy, interp, objc, objv)
|
||||
!contextObj) {
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot access options without an object context",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2179,7 +2238,7 @@ Itk_ArchOptionRemoveCmd(dummy, interp, objc, objv)
|
||||
|
||||
opt = Itk_FindClassOption(cdefn, tail);
|
||||
if (!opt) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"option \"", tail, "\" not defined in class \"",
|
||||
cdefn->fullname, "\"",
|
||||
(char*)NULL);
|
||||
@@ -2207,7 +2266,7 @@ Itk_ArchOptionRemoveCmd(dummy, interp, objc, objv)
|
||||
|
||||
entry = Tcl_FindHashEntry(&info->components, head);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"name \"", head, "\" is not a component",
|
||||
(char*)NULL);
|
||||
*sep = tmp;
|
||||
@@ -2235,7 +2294,7 @@ Itk_ArchOptionRemoveCmd(dummy, interp, objc, objv)
|
||||
/*
|
||||
* Anything else is an error.
|
||||
*/
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option \"", name, "\": should be one of...\n",
|
||||
" class::option\n",
|
||||
" component.option",
|
||||
@@ -2284,11 +2343,12 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
Tcl_Obj *CONST objv[]; /* argument objects */
|
||||
{
|
||||
int i, result;
|
||||
char *token, *name, *val;
|
||||
char *token;
|
||||
CONST char *name, *val;
|
||||
Tcl_Namespace *callingNs;
|
||||
ItclClass *contextClass;
|
||||
ItclObject *contextObj;
|
||||
Tcl_CallFrame *framePtr;
|
||||
Itcl_CallFrame *framePtr;
|
||||
Tcl_HashEntry *entry;
|
||||
Tcl_HashSearch place;
|
||||
ArchInfo *info;
|
||||
@@ -2301,7 +2361,7 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: should be \"object ",
|
||||
token, " ?name option arg arg...?\"",
|
||||
(char*)NULL);
|
||||
@@ -2329,7 +2389,7 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
archComp = (ArchComponent*)Tcl_GetHashValue(entry);
|
||||
if (Itcl_CanAccess(archComp->member, callingNs)) {
|
||||
name = Tcl_GetHashKey(&info->components, entry);
|
||||
Tcl_AppendElement(interp, name);
|
||||
Tcl_AppendElement(interp, (CONST84 char *)name);
|
||||
}
|
||||
entry = Tcl_NextHashEntry(&place);
|
||||
}
|
||||
@@ -2348,14 +2408,14 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
|
||||
if (archComp == NULL) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"name \"", token, "\" is not a component",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (!Itcl_CanAccess(archComp->member, callingNs)) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"can't access component \"", token, "\" from context \"",
|
||||
callingNs->fullName, "\"",
|
||||
(char*)NULL);
|
||||
@@ -2370,7 +2430,7 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
val = Tcl_GetVar2(interp, "itk_component", token, 0);
|
||||
if (!val) {
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"internal error: cannot access itk_component(", token, ")",
|
||||
(char*)NULL);
|
||||
|
||||
@@ -2383,7 +2443,11 @@ Itk_ArchCompAccessCmd(dummy, interp, objc, objv)
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetResult(interp, val, TCL_VOLATILE);
|
||||
/*
|
||||
* Casting away CONST is safe because TCL_VOLATILE guarantees
|
||||
* CONST treatment.
|
||||
*/
|
||||
Tcl_SetResult(interp, (char *) val, TCL_VOLATILE);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2437,7 +2501,8 @@ Itk_ArchConfigureCmd(dummy, interp, objc, objv)
|
||||
Tcl_Obj *CONST objv[]; /* argument objects */
|
||||
{
|
||||
int i;
|
||||
char *token, *val;
|
||||
CONST char *val;
|
||||
char *token;
|
||||
ItclClass *contextClass;
|
||||
ItclObject *contextObj;
|
||||
ArchInfo *info;
|
||||
@@ -2450,7 +2515,7 @@ Itk_ArchConfigureCmd(dummy, interp, objc, objv)
|
||||
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: should be \"object ",
|
||||
token, " ?-option? ?value -option value...?\"",
|
||||
(char*)NULL);
|
||||
@@ -2503,7 +2568,7 @@ Itk_ArchConfigureCmd(dummy, interp, objc, objv)
|
||||
token = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
entry = Tcl_FindHashEntry(&info->options, token);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"unknown option \"", token, "\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2523,7 +2588,7 @@ Itk_ArchConfigureCmd(dummy, interp, objc, objv)
|
||||
(archOpt->resClass) ? archOpt->resClass : "");
|
||||
Tcl_AppendElement(interp,
|
||||
(archOpt->init) ? archOpt->init : "");
|
||||
Tcl_AppendElement(interp, val);
|
||||
Tcl_AppendElement(interp, (CONST84 char *)val);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -2533,16 +2598,17 @@ Itk_ArchConfigureCmd(dummy, interp, objc, objv)
|
||||
* Look up each option and assign the new value.
|
||||
*/
|
||||
for (objc--,objv++; objc > 0; objc-=2, objv+=2) {
|
||||
char *value;
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
if (objc < 2) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"value for \"", token, "\" missing",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
val = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
value = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
|
||||
if (Itk_ArchConfigOption(interp, info, token, val) != TCL_OK) {
|
||||
if (Itk_ArchConfigOption(interp, info, token, value) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -2572,7 +2638,7 @@ Itk_ArchCgetCmd(dummy, interp, objc, objv)
|
||||
int objc; /* number of arguments */
|
||||
Tcl_Obj *CONST objv[]; /* argument objects */
|
||||
{
|
||||
char *token, *val;
|
||||
CONST char *token, *val;
|
||||
ItclClass *contextClass;
|
||||
ItclObject *contextObj;
|
||||
ArchInfo *info;
|
||||
@@ -2584,7 +2650,7 @@ Itk_ArchCgetCmd(dummy, interp, objc, objv)
|
||||
|
||||
token = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"improper usage: should be \"object ", token, " -option\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2605,7 +2671,7 @@ Itk_ArchCgetCmd(dummy, interp, objc, objv)
|
||||
token = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
entry = Tcl_FindHashEntry(&info->options, token);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"unknown option \"", token, "\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2618,7 +2684,11 @@ Itk_ArchCgetCmd(dummy, interp, objc, objv)
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_SetResult(interp, val, TCL_VOLATILE);
|
||||
/*
|
||||
* Casting away CONST is safe because TCL_VOLATILE guarantees
|
||||
* CONST treatment.
|
||||
*/
|
||||
Tcl_SetResult(interp, (char *) val, TCL_VOLATILE);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2642,13 +2712,13 @@ Itk_PropagateOption(interp, contextObj, cdata, newval)
|
||||
Tcl_Interp *interp; /* interpreter managing the class */
|
||||
ItclObject *contextObj; /* itcl object being configured */
|
||||
ClientData cdata; /* command prefix to use for configuration */
|
||||
char *newval; /* new value for this option */
|
||||
CONST char *newval; /* new value for this option */
|
||||
{
|
||||
ConfigCmdline *cmdlinePtr = (ConfigCmdline*)cdata;
|
||||
int result;
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
objPtr = Tcl_NewStringObj(newval, -1);
|
||||
objPtr = Tcl_NewStringObj((CONST84 char *)newval, -1);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
|
||||
cmdlinePtr->objv[3] = objPtr;
|
||||
@@ -2678,15 +2748,15 @@ Itk_PropagatePublicVar(interp, contextObj, cdata, newval)
|
||||
Tcl_Interp *interp; /* interpreter managing the class */
|
||||
ItclObject *contextObj; /* itcl object being configured */
|
||||
ClientData cdata; /* command prefix to use for configuration */
|
||||
char *newval; /* new value for this option */
|
||||
CONST char *newval; /* new value for this option */
|
||||
{
|
||||
ItclVarDefn *vdefn = (ItclVarDefn*)cdata;
|
||||
|
||||
int result;
|
||||
char *val;
|
||||
CONST char *val;
|
||||
ItclContext context;
|
||||
ItclMemberCode *mcode;
|
||||
Tcl_CallFrame *uplevelFramePtr, *oldFramePtr;
|
||||
Itcl_CallFrame *uplevelFramePtr, *oldFramePtr;
|
||||
|
||||
/*
|
||||
* Update the public variable with the new option value.
|
||||
@@ -2699,8 +2769,12 @@ Itk_PropagatePublicVar(interp, contextObj, cdata, newval)
|
||||
contextObj->classDefn, contextObj, &context);
|
||||
|
||||
if (result == TCL_OK) {
|
||||
val = Tcl_SetVar2(interp, vdefn->member->fullname, (char*)NULL,
|
||||
newval, TCL_LEAVE_ERR_MSG);
|
||||
/*
|
||||
* Casting away CONST of newval only to satisfy Tcl 8.3 and
|
||||
* earlier headers.
|
||||
*/
|
||||
val = Tcl_SetVar2(interp, vdefn->member->fullname, (char *) NULL,
|
||||
(char *) newval, TCL_LEAVE_ERR_MSG);
|
||||
|
||||
if (!val) {
|
||||
result = TCL_ERROR;
|
||||
@@ -2771,22 +2845,23 @@ static int
|
||||
Itk_ArchSetOption(interp, info, name, value)
|
||||
Tcl_Interp *interp; /* interpreter managing this widget */
|
||||
ArchInfo *info; /* Archetype info */
|
||||
char *name; /* name of configuration option */
|
||||
char *value; /* new value for configuration option */
|
||||
CONST char *name; /* name of configuration option */
|
||||
CONST char *value; /* new value for configuration option */
|
||||
{
|
||||
Tcl_HashEntry *entry;
|
||||
ArchOption *archOpt;
|
||||
|
||||
entry = Tcl_FindHashEntry(&info->options, name);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"unknown option \"", name, "\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
archOpt = (ArchOption*)Tcl_GetHashValue(entry);
|
||||
|
||||
if (!Tcl_SetVar2(interp, "itk_option", archOpt->switchName, value, 0)) {
|
||||
if (!Tcl_SetVar2(interp, "itk_option", archOpt->switchName,
|
||||
(CONST84 char *)value, 0)) {
|
||||
Itk_ArchOptAccessError(interp, info, archOpt);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -2818,11 +2893,12 @@ static int
|
||||
Itk_ArchConfigOption(interp, info, name, value)
|
||||
Tcl_Interp *interp; /* interpreter managing this widget */
|
||||
ArchInfo *info; /* Archetype info */
|
||||
char *name; /* name of configuration option */
|
||||
char *name; /* name of configuration option */
|
||||
char *value; /* new value for configuration option */
|
||||
{
|
||||
int result;
|
||||
char *v, *lastval;
|
||||
CONST char *v;
|
||||
char *lastval;
|
||||
Tcl_HashEntry *entry;
|
||||
ArchOption *archOpt;
|
||||
Itcl_ListElem *part;
|
||||
@@ -2834,7 +2910,12 @@ Itk_ArchConfigOption(interp, info, name, value)
|
||||
*/
|
||||
entry = Tcl_FindHashEntry(&info->options, name);
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
/* Bug 227876
|
||||
* Ensure that the interp result is unshared.
|
||||
*/
|
||||
|
||||
Tcl_ResetResult (interp);
|
||||
Tcl_AppendResult(interp,
|
||||
"unknown option \"", name, "\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -2958,7 +3039,7 @@ Itk_ArchOptAccessError(interp, info, archOpt)
|
||||
{
|
||||
Tcl_ResetResult(interp);
|
||||
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"internal error: cannot access itk_option(", archOpt->switchName, ")",
|
||||
(char*)NULL);
|
||||
|
||||
@@ -2996,7 +3077,7 @@ Itk_GetArchInfo(interp, contextObj, infoPtr)
|
||||
entry = Tcl_FindHashEntry(objsWithArchInfo, (char*)contextObj);
|
||||
|
||||
if (!entry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"internal error: no Archetype information for widget",
|
||||
(char*)NULL);
|
||||
|
||||
@@ -3038,7 +3119,8 @@ Itk_CreateArchComponent(interp, info, name, cdefn, accessCmd)
|
||||
ItclClass *cdefn; /* component created in this class */
|
||||
Tcl_Command accessCmd; /* access command for component */
|
||||
{
|
||||
char *wname, *init;
|
||||
CONST char *init;
|
||||
CONST char *wname;
|
||||
ArchComponent *archComp;
|
||||
ArchOption *archOpt;
|
||||
Tk_Window tkwin;
|
||||
@@ -3050,18 +3132,18 @@ Itk_CreateArchComponent(interp, info, name, cdefn, accessCmd)
|
||||
* Save this component in the itk_component() array.
|
||||
*/
|
||||
wname = Tcl_GetCommandName(interp, accessCmd);
|
||||
Tcl_SetVar2(interp, "itk_component", name, wname, 0);
|
||||
Tcl_SetVar2(interp, "itk_component", name, (char *)wname, 0);
|
||||
|
||||
/*
|
||||
* If the symbolic name for the component is "hull", then this
|
||||
* is the toplevel or frame that embodies a mega-widget. Update
|
||||
* the Archtype info to include the window token.
|
||||
*/
|
||||
tkwin = Tk_NameToWindow(interp, wname, Tk_MainWindow(interp));
|
||||
tkwin = Tk_NameToWindow(interp, (char *)wname, Tk_MainWindow(interp));
|
||||
|
||||
if (strcmp(name, "hull") == 0) {
|
||||
if (tkwin == NULL) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot find hull window with access command \"", wname, "\"",
|
||||
(char*)NULL);
|
||||
return NULL;
|
||||
@@ -3116,6 +3198,8 @@ Itk_CreateArchComponent(interp, info, name, cdefn, accessCmd)
|
||||
archComp->member = memPtr;
|
||||
archComp->accessCmd = accessCmd;
|
||||
archComp->tkwin = tkwin;
|
||||
archComp->pathName = (char *) ckalloc((unsigned)(strlen(wname)+1));
|
||||
strcpy(archComp->pathName, wname);
|
||||
|
||||
return archComp;
|
||||
}
|
||||
@@ -3134,6 +3218,7 @@ Itk_DelArchComponent(archComp)
|
||||
ArchComponent *archComp; /* pointer to component data */
|
||||
{
|
||||
ckfree((char*)archComp->member);
|
||||
ckfree((char*)archComp->pathName);
|
||||
ckfree((char*)archComp);
|
||||
}
|
||||
|
||||
@@ -3167,7 +3252,7 @@ Itk_GetArchOption(interp, info, switchName, resName, resClass,
|
||||
char *switchName; /* name of command-line switch */
|
||||
char *resName; /* resource name in X11 database */
|
||||
char *resClass; /* resource class name in X11 database */
|
||||
char *defVal; /* last-resort default value */
|
||||
CONST char *defVal; /* last-resort default value */
|
||||
char *currVal; /* current option value */
|
||||
ArchOption **aoPtr; /* returns: option record */
|
||||
{
|
||||
@@ -3203,7 +3288,7 @@ Itk_GetArchOption(interp, info, switchName, resName, resClass,
|
||||
strcpy(archOpt->resName, resName);
|
||||
}
|
||||
else if (resName && strcmp(archOpt->resName, resName) != 0) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource name \"", resName, "\" for option \"",
|
||||
name, "\": should be \"", archOpt->resName, "\"",
|
||||
(char*)NULL);
|
||||
@@ -3216,7 +3301,7 @@ Itk_GetArchOption(interp, info, switchName, resName, resClass,
|
||||
strcpy(archOpt->resClass, resClass);
|
||||
}
|
||||
else if (resClass && strcmp(archOpt->resClass, resClass) != 0) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource class \"", resClass, "\" for option \"",
|
||||
name, "\": should be \"", archOpt->resClass, "\"",
|
||||
(char*)NULL);
|
||||
@@ -3298,13 +3383,14 @@ Itk_InitArchOption(interp, info, archOpt, defVal, currVal)
|
||||
Tcl_Interp *interp; /* interpreter managing the object */
|
||||
ArchInfo *info; /* info for Archetype mega-widget */
|
||||
ArchOption *archOpt; /* option to initialize */
|
||||
char *defVal; /* last-resort default value */
|
||||
CONST char *defVal; /* last-resort default value */
|
||||
char *currVal; /* current option value */
|
||||
{
|
||||
char *init = NULL;
|
||||
CONST char *init = NULL;
|
||||
|
||||
int result;
|
||||
char c, *ival;
|
||||
CONST char *ival;
|
||||
char c;
|
||||
ItclContext context;
|
||||
|
||||
/*
|
||||
@@ -3354,8 +3440,12 @@ Itk_InitArchOption(interp, info, archOpt, defVal, currVal)
|
||||
info->itclObj->classDefn, info->itclObj, &context);
|
||||
|
||||
if (result == TCL_OK) {
|
||||
/*
|
||||
* Casting away CONST of ival only to satisfy Tcl 8.3 and
|
||||
* earlier headers.
|
||||
*/
|
||||
Tcl_SetVar2(interp, "itk_option", archOpt->switchName,
|
||||
(ival) ? ival : "", 0);
|
||||
(char *)((ival) ? ival : ""), 0);
|
||||
Itcl_PopContext(interp, &context);
|
||||
}
|
||||
|
||||
@@ -3473,12 +3563,12 @@ Itk_AddOptionPart(interp, info, switchName, resName, resClass,
|
||||
char *switchName; /* name of command-line switch */
|
||||
char *resName; /* resource name in X11 database */
|
||||
char *resClass; /* resource class name in X11 database */
|
||||
char *defVal; /* last-resort default value */
|
||||
CONST char *defVal; /* last-resort default value */
|
||||
char *currVal; /* current value (or NULL) */
|
||||
ArchOptionPart *optPart; /* part to be added in */
|
||||
ArchOption **raOpt; /* returns: option containing new part */
|
||||
{
|
||||
char *init = NULL;
|
||||
CONST char *init = NULL;
|
||||
|
||||
int result;
|
||||
ArchOption *archOpt;
|
||||
|
||||
+82
-11
@@ -15,8 +15,6 @@
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
*
|
||||
* RCS: $Id: itk_cmds.c,v 1.4 1998/08/18 10:48:32 suresh Exp $
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -25,11 +23,23 @@
|
||||
*/
|
||||
#include "itk.h"
|
||||
|
||||
/*
|
||||
* The following script is used to initialize Itcl in a safe interpreter.
|
||||
*/
|
||||
|
||||
static char safeInitScript[] =
|
||||
"proc ::itcl::local {class name args} {\n\
|
||||
set ptr [uplevel [list $class $name] $args]\n\
|
||||
uplevel [list set itcl-local-$ptr $ptr]\n\
|
||||
set cmd [uplevel namespace which -command $ptr]\n\
|
||||
uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\
|
||||
return $ptr\n\
|
||||
}";
|
||||
|
||||
/*
|
||||
* FORWARD DECLARATIONS
|
||||
*/
|
||||
static int Initialize _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
|
||||
/*
|
||||
* The following string is the startup script executed in new
|
||||
* interpreters. It looks on disk in several different directories
|
||||
@@ -61,6 +71,13 @@ namespace eval ::itk {\n\
|
||||
lappend dirs [file join $bindir .. library]\n\
|
||||
lappend dirs [file join $bindir .. .. library]\n\
|
||||
lappend dirs [file join $bindir .. .. itk library]\n\
|
||||
# On MacOSX, check the directories in the tcl_pkgPath\n\
|
||||
if {[string equal $::tcl_platform(platform) \"unix\"] && \
|
||||
[string equal $::tcl_platform(os) \"Darwin\"]} {\n\
|
||||
foreach d $::tcl_pkgPath {\n\
|
||||
lappend dirs [file join $d itk$version]\n\
|
||||
}\n\
|
||||
}\n\
|
||||
}\n\
|
||||
foreach i $dirs {\n\
|
||||
set library $i\n\
|
||||
@@ -79,7 +96,6 @@ namespace eval ::itk {\n\
|
||||
}\n\
|
||||
_find_init\n\
|
||||
}";
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -101,12 +117,28 @@ Initialize(interp)
|
||||
Tcl_Namespace *itkNs, *parserNs;
|
||||
ClientData parserInfo;
|
||||
|
||||
#ifndef USE_TCL_STUBS
|
||||
if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_PkgRequire(interp, "Itcl", ITCL_VERSION, 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#else
|
||||
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tk_InitStubs(interp, "8.1", 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
};
|
||||
if (Itcl_InitStubs(interp, ITCL_VERSION, 1) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Add the "itk_option" ensemble to the itcl class definition parser.
|
||||
@@ -115,7 +147,7 @@ Initialize(interp)
|
||||
(Tcl_Namespace*)NULL, /* flags */ 0);
|
||||
|
||||
if (!parserNs) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"cannot initialize [incr Tk]: [incr Tcl] has not been installed\n",
|
||||
"Make sure that Itcl_Init() is called before Itk_Init()",
|
||||
(char*)NULL);
|
||||
@@ -183,15 +215,29 @@ Initialize(interp)
|
||||
Tcl_CreateObjCommand(interp, "::itcl::configbody", Itk_ConfigBodyCmd,
|
||||
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
|
||||
|
||||
Tcl_SetVar(interp, "::itk::version", ITCL_VERSION, 0);
|
||||
Tcl_SetVar(interp, "::itk::patchLevel", ITCL_PATCH_LEVEL, 0);
|
||||
Tcl_SetVar(interp, "::itk::version", ITK_VERSION, 0);
|
||||
Tcl_SetVar(interp, "::itk::patchLevel", ITK_PATCH_LEVEL, 0);
|
||||
|
||||
/*
|
||||
* Signal that the package has been loaded.
|
||||
* Signal that the package has been loaded and provide the Itk Stubs table
|
||||
* for dependent modules. I know this is unlikely, but possible that
|
||||
* someone could be extending Itk. Who is to say that Itk is the
|
||||
* end-of-the-line?
|
||||
*/
|
||||
if (Tcl_PkgProvide(interp, "Itk", ITCL_VERSION) != TCL_OK) {
|
||||
|
||||
#if TCL_DOES_STUBS
|
||||
{
|
||||
extern ItkStubs itkStubs;
|
||||
if (Tcl_PkgProvideEx(interp, "Itk", ITK_VERSION,
|
||||
(ClientData) &itkStubs) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (Tcl_PkgProvide(interp, "Itk", ITK_VERSION) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#endif
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -220,6 +266,31 @@ Itk_Init(interp)
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
* Itk_SafeInit()
|
||||
*
|
||||
* Invoked whenever a new SAFE INTERPRETER is created to install
|
||||
* the [incr Tcl] package.
|
||||
*
|
||||
* Creates the "::itk" namespace and installs access commands for
|
||||
* creating classes and querying info.
|
||||
*
|
||||
* Returns TCL_OK on success, or TCL_ERROR (along with an error
|
||||
* message in the interpreter) if anything goes wrong.
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
Itk_SafeInit(interp)
|
||||
Tcl_Interp *interp; /* interpreter to be updated */
|
||||
{
|
||||
if (Initialize(interp) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return Tcl_Eval(interp, safeInitScript);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -275,7 +346,7 @@ Itk_ConfigBodyCmd(dummy, interp, objc, objv)
|
||||
Itcl_ParseNamespPath(token, &buffer, &head, &tail);
|
||||
|
||||
if (!head || *head == '\0') {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"missing class specifier for body declaration \"", token, "\"",
|
||||
(char*)NULL);
|
||||
result = TCL_ERROR;
|
||||
|
||||
+15
-16
@@ -15,8 +15,6 @@
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
*
|
||||
* RCS: $Id: itk_option.c,v 1.1 1998/07/27 18:45:25 stanton Exp $
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -29,7 +27,7 @@
|
||||
* FORWARD DECLARATIONS
|
||||
*/
|
||||
static char* ItkTraceClassDestroy _ANSI_ARGS_((ClientData cdata,
|
||||
Tcl_Interp *interp, char *name1, char *name2, int flags));
|
||||
Tcl_Interp *interp, CONST char *name1, CONST char *name2, int flags));
|
||||
static Tcl_HashTable* ItkGetClassesWithOptInfo _ANSI_ARGS_((
|
||||
Tcl_Interp *interp));
|
||||
static void ItkFreeClassesWithOptInfo _ANSI_ARGS_((ClientData cdata,
|
||||
@@ -84,13 +82,13 @@ Itk_ClassOptionDefineCmd(clientData, interp, objc, objv)
|
||||
|
||||
switchName = Tcl_GetStringFromObj(objv[1], (int*)NULL);
|
||||
if (*switchName != '-') {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option name \"", switchName, "\": should be -", switchName,
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (strstr(switchName, ".")) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad option name \"", switchName, "\": illegal character \".\"",
|
||||
(char*)NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -98,7 +96,7 @@ Itk_ClassOptionDefineCmd(clientData, interp, objc, objv)
|
||||
|
||||
resName = Tcl_GetStringFromObj(objv[2], (int*)NULL);
|
||||
if (!islower((int)*resName)) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource name \"", resName,
|
||||
"\": should start with a lower case letter",
|
||||
(char*)NULL);
|
||||
@@ -107,7 +105,7 @@ Itk_ClassOptionDefineCmd(clientData, interp, objc, objv)
|
||||
|
||||
resClass = Tcl_GetStringFromObj(objv[3], (int*)NULL);
|
||||
if (!isupper((int)*resClass)) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"bad resource class \"", resClass,
|
||||
"\": should start with an upper case letter",
|
||||
(char*)NULL);
|
||||
@@ -126,7 +124,7 @@ Itk_ClassOptionDefineCmd(clientData, interp, objc, objv)
|
||||
entry = Tcl_CreateHashEntry(&optTable->options, switchName, &newEntry);
|
||||
|
||||
if (!newEntry) {
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"option \"", switchName, "\" already defined in class \"",
|
||||
cdefn->fullname, "\"",
|
||||
(char*)NULL);
|
||||
@@ -176,7 +174,7 @@ Itk_ClassOptionIllegalCmd(clientData, interp, objc, objv)
|
||||
{
|
||||
char *op = Tcl_GetStringFromObj(objv[0], (int*)NULL);
|
||||
|
||||
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
|
||||
Tcl_AppendResult(interp,
|
||||
"can only ", op, " options for a specific widget\n",
|
||||
"(move this command into the constructor)",
|
||||
(char*)NULL);
|
||||
@@ -204,7 +202,7 @@ Itk_ConfigClassOption(interp, contextObj, cdata, newval)
|
||||
Tcl_Interp *interp; /* interpreter managing the class */
|
||||
ItclObject *contextObj; /* object being configured */
|
||||
ClientData cdata; /* class option */
|
||||
char *newval; /* new value for this option */
|
||||
CONST char *newval; /* new value for this option */
|
||||
{
|
||||
ItkClassOption *opt = (ItkClassOption*)cdata;
|
||||
int result = TCL_OK;
|
||||
@@ -250,7 +248,7 @@ Itk_CreateClassOptTable(interp, cdefn)
|
||||
Tcl_HashTable *itkClasses;
|
||||
Tcl_HashEntry *entry;
|
||||
ItkClassOptTable *optTable;
|
||||
Tcl_CallFrame frame;
|
||||
Itcl_CallFrame frame;
|
||||
|
||||
/*
|
||||
* Look for the specified class definition in the table.
|
||||
@@ -271,13 +269,13 @@ Itk_CreateClassOptTable(interp, cdefn)
|
||||
|
||||
Tcl_SetHashValue(entry, (ClientData)optTable);
|
||||
|
||||
result = Tcl_PushCallFrame(interp, &frame,
|
||||
result = Tcl_PushCallFrame(interp, (Tcl_CallFrame *) &frame,
|
||||
cdefn->namesp, /* isProcCallFrame */ 0);
|
||||
|
||||
if (result == TCL_OK) {
|
||||
Tcl_TraceVar(interp, "_itk_option_data",
|
||||
(TCL_TRACE_UNSETS | TCL_NAMESPACE_ONLY),
|
||||
ItkTraceClassDestroy, (ClientData)cdefn);
|
||||
(Tcl_VarTraceProc*) ItkTraceClassDestroy, (ClientData)cdefn);
|
||||
Tcl_PopCallFrame(interp);
|
||||
}
|
||||
}
|
||||
@@ -340,8 +338,8 @@ static char*
|
||||
ItkTraceClassDestroy(cdata, interp, name1, name2, flags)
|
||||
ClientData cdata; /* class definition data */
|
||||
Tcl_Interp *interp; /* interpreter managing the class */
|
||||
char *name1; /* name of variable involved in trace */
|
||||
char *name2; /* name of array element within variable */
|
||||
CONST char *name1; /* name of variable involved in trace */
|
||||
CONST char *name2; /* name of array element within variable */
|
||||
int flags; /* flags describing trace */
|
||||
{
|
||||
ItclClass *cdefn = (ItclClass*)cdata;
|
||||
@@ -418,7 +416,8 @@ Itk_CreateClassOption(interp, cdefn, switchName, resName, resClass,
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Itcl_PreserveData((ClientData)mcode);
|
||||
Itcl_EventuallyFree((ClientData)mcode, Itcl_DeleteMemberCode);
|
||||
Itcl_EventuallyFree((ClientData)mcode,
|
||||
(Tcl_FreeProc*) Itcl_DeleteMemberCode);
|
||||
}
|
||||
else {
|
||||
mcode = NULL;
|
||||
|
||||
+6
-6
@@ -15,8 +15,6 @@
|
||||
* Bell Labs Innovations for Lucent Technologies
|
||||
* mmclennan@lucent.com
|
||||
* http://www.tcltk.com/itcl
|
||||
*
|
||||
* RCS: $Id: itk_util.c,v 1.1 1998/07/27 18:45:25 stanton Exp $
|
||||
* ========================================================================
|
||||
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
* ------------------------------------------------------------------------
|
||||
@@ -103,11 +101,12 @@ Itk_OptListAdd(olist, entry)
|
||||
*/
|
||||
first = 0;
|
||||
last = olist->len-1;
|
||||
swname = Tcl_GetHashKey(olist->options, entry) + 1;
|
||||
swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;
|
||||
|
||||
while (last >= first) {
|
||||
pos = (first+last)/2;
|
||||
optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;
|
||||
optname = ((char *)Tcl_GetHashKey(olist->options,
|
||||
olist->list[pos])) + 1;
|
||||
if (*swname == *optname) {
|
||||
cmp = strcmp(swname, optname);
|
||||
if (cmp == 0) {
|
||||
@@ -164,11 +163,12 @@ Itk_OptListRemove(olist, entry)
|
||||
|
||||
first = 0;
|
||||
last = olist->len-1;
|
||||
swname = Tcl_GetHashKey(olist->options, entry) + 1;
|
||||
swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;
|
||||
|
||||
while (last >= first) {
|
||||
pos = (first+last)/2;
|
||||
optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;
|
||||
optname = ((char *)Tcl_GetHashKey(olist->options,
|
||||
olist->list[pos])) + 1;
|
||||
if (*swname == *optname) {
|
||||
cmp = strcmp(swname, optname);
|
||||
if (cmp == 0) {
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
# Itcl's version number.
|
||||
ITCL_VERSION='@ITCL_VERSION@'
|
||||
ITCL_MAJOR_VERSION='@ITCL_MAJOR_VERSION@'
|
||||
ITCL_MINOR_VERSION='@ITCL_MINOR_VERSION@'
|
||||
|
||||
# The name of the Itk library (may be either a .a file or a shared library):
|
||||
ITK_LIB_FILE=@ITK_LIB_FILE@
|
||||
@@ -27,6 +25,17 @@ ITK_BUILD_LIB_SPEC='@ITK_BUILD_LIB_SPEC@'
|
||||
# installed directory.
|
||||
ITK_LIB_SPEC='@ITK_LIB_SPEC@'
|
||||
|
||||
# The name of the Itk stub library (a .a file):
|
||||
ITK_STUB_LIB_FILE=@ITK_STUB_LIB_FILE@
|
||||
|
||||
# String to pass to linker to pick up the Itk stub library from its
|
||||
# build directory.
|
||||
ITK_BUILD_STUB_LIB_SPEC='@ITK_BUILD_STUB_LIB_SPEC@'
|
||||
|
||||
# String to pass to linker to pick up the Itk stub library from its
|
||||
# installed directory.
|
||||
ITK_STUB_LIB_SPEC='@ITK_STUB_LIB_SPEC@'
|
||||
|
||||
# Location of the top-level source directories from which [incr Tk]
|
||||
# was built. This is the directory that contains a README file as well
|
||||
# as subdirectories such as generic, unix, etc. If [incr Tk] was
|
||||
@@ -45,8 +45,6 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: Archetype.itk,v 1.1 1998/07/27 18:45:26 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
|
||||
+13
-4
@@ -23,8 +23,6 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: Toplevel.itk,v 1.1 1998/07/27 18:45:27 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
@@ -44,9 +42,9 @@ itcl::class itk::Toplevel {
|
||||
itk_component add hull {
|
||||
toplevel $itk_hull -class [namespace tail [info class]]
|
||||
} {
|
||||
keep -background -cursor -takefocus
|
||||
keep -menu -background -cursor -takefocus
|
||||
}
|
||||
bind itk-delete-$itk_hull <Destroy> "itcl::delete object $this"
|
||||
bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this]
|
||||
|
||||
set tags [bindtags $itk_hull]
|
||||
bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
|
||||
@@ -63,6 +61,17 @@ itcl::class itk::Toplevel {
|
||||
}
|
||||
destroy $itk_hull
|
||||
}
|
||||
itk_component delete hull
|
||||
|
||||
set components [component]
|
||||
foreach component $components {
|
||||
set path($component) [component $component]
|
||||
}
|
||||
foreach component $components {
|
||||
if {[winfo exists $path($component)]} {
|
||||
destroy $path($component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
itk_option define -title title Title "" {
|
||||
|
||||
+12
-3
@@ -21,8 +21,6 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: Widget.itk,v 1.1 1998/07/27 18:45:28 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
@@ -47,7 +45,7 @@ itcl::class itk::Widget {
|
||||
} {
|
||||
keep -background -cursor
|
||||
}
|
||||
bind itk-delete-$itk_hull <Destroy> "itcl::delete object $this"
|
||||
bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this]
|
||||
|
||||
set tags [bindtags $itk_hull]
|
||||
bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
|
||||
@@ -64,6 +62,17 @@ itcl::class itk::Widget {
|
||||
}
|
||||
destroy $itk_hull
|
||||
}
|
||||
itk_component delete hull
|
||||
|
||||
set components [component]
|
||||
foreach component $components {
|
||||
set path($component) [component $component]
|
||||
}
|
||||
foreach component $components {
|
||||
if {[winfo exists $path($component)]} {
|
||||
destroy $path($component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private variable itk_hull ""
|
||||
|
||||
+21
-2
@@ -8,8 +8,6 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: itk.tcl,v 1.1 1998/07/27 18:45:28 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
@@ -25,6 +23,27 @@ if {$tcl_platform(os) == "MacOS"} {
|
||||
lappend auto_path ${itk::library}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# USAGE: itk::remove_destroy_hook <widget>
|
||||
#
|
||||
# Used internally via "itk_component delete" when disconnecting a
|
||||
# component <widget> from the mega-widget that contains it.
|
||||
# Each component has a special binding for the <Destroy> event
|
||||
# that causes it to disconnect itself from its parent when destroyed.
|
||||
# This procedure removes the binding from the binding tag list and
|
||||
# deletes the binding. It is much easier to implement this in
|
||||
# Tcl than C.
|
||||
# ----------------------------------------------------------------------
|
||||
proc ::itk::remove_destroy_hook {widget} {
|
||||
if {![winfo exists $widget]} {return}
|
||||
set tags [bindtags $widget]
|
||||
set i [lsearch $tags "itk-destroy-$widget"]
|
||||
if {$i >= 0} {
|
||||
bindtags $widget [lreplace $tags $i $i]
|
||||
}
|
||||
bind itk-destroy-$widget <Destroy> {}
|
||||
}
|
||||
|
||||
#
|
||||
# Define "usual" option-handling code for the Tk widgets:
|
||||
#
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* MW_ItkHeader.pch --
|
||||
*
|
||||
* This file is the source for a pre-compilied header that gets used
|
||||
* for all files in the Tk projects. This make compilies go a bit
|
||||
* faster. This file is only intended to be used in the MetroWerks
|
||||
* CodeWarrior environment. It essentially acts as a place to set
|
||||
* compiler flags. See MetroWerks documention for more details.
|
||||
*
|
||||
* Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) MW_TkHeader.pch 1.16 96/09/04 17:01:00
|
||||
*/
|
||||
|
||||
/*
|
||||
* Support for automatically naming the precompiled header file ...
|
||||
*/
|
||||
#if __POWERPC__
|
||||
#pragma precompile_target "MW_ItkHeaderPPC"
|
||||
#include "MW_TkHeaderPPC"
|
||||
#elif __CFM68K__
|
||||
#pragma precompile_target "MW_ItkHeaderCFM68K"
|
||||
#include "MW_TkHeaderCFM68K"
|
||||
#else
|
||||
#pragma precompile_target "MW_ItkHeader68K"
|
||||
#include "MW_TkHeader68K"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macintosh Tcl must be compiled with certain compiler options to
|
||||
* ensure that it will work correctly. The following pragmas are
|
||||
* used to ensure that those options are set correctly. An error
|
||||
* will occur at compile time if they are not set correctly.
|
||||
*/
|
||||
|
||||
#if !__option(enumsalwaysint)
|
||||
#error Tcl requires the Metrowerks setting "Enums always ints".
|
||||
#endif
|
||||
|
||||
#if !defined(__POWERPC__)
|
||||
#if !__option(far_data)
|
||||
#error Tcl requires the Metrowerks setting "Far data".
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__POWERPC__)
|
||||
#if !__option(fourbyteints)
|
||||
#error Tcl requires the Metrowerks setting "4 byte ints".
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__POWERPC__)
|
||||
#if !__option(IEEEdoubles)
|
||||
#error Tcl requires the Metrowerks setting "8 byte doubles".
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <tcl.h>
|
||||
#include <tk.h>
|
||||
#include <itcl.h>
|
||||
|
||||
/*
|
||||
* Place any includes below that will are needed by the majority of the
|
||||
* and is OK to be in any file in the system. The pragma's are used
|
||||
* to control what functions are exported in the Tcl shared library.
|
||||
*/
|
||||
|
||||
#pragma export on
|
||||
#include "itk.h"
|
||||
#pragma export reset
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* tkMacLibrary.r --
|
||||
*
|
||||
* This file creates resources for use in most Tk applications.
|
||||
* This is designed to be an example of using the Tcl/Tk
|
||||
* libraries in a Macintosh Application.
|
||||
*
|
||||
* Copyright (c) 1996 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) tkMacLibrary.r 1.5 96/10/03 17:54:21
|
||||
*/
|
||||
|
||||
#include <Types.r>
|
||||
#include <SysTypes.r>
|
||||
#include <AEUserTermTypes.r>
|
||||
|
||||
/*
|
||||
* The folowing include and defines help construct
|
||||
* the version string for Tcl.
|
||||
*/
|
||||
|
||||
#define RESOURCE_INCLUDED
|
||||
#include <tcl.h>
|
||||
#include <tk.h>
|
||||
#include "itcl.h"
|
||||
#include "itk.h"
|
||||
|
||||
#if (TK_RELEASE_LEVEL == 0)
|
||||
# define RELEASE_LEVEL alpha
|
||||
#elif (TK_RELEASE_LEVEL == 1)
|
||||
# define RELEASE_LEVEL beta
|
||||
#elif (TK_RELEASE_LEVEL == 2)
|
||||
# define RELEASE_LEVEL final
|
||||
#endif
|
||||
|
||||
#if (TK_RELEASE_LEVEL == 2)
|
||||
# define MINOR_VERSION (ITCL_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
|
||||
#else
|
||||
# define MINOR_VERSION ITCL_MINOR_VERSION * 16
|
||||
#endif
|
||||
|
||||
#define RELEASE_CODE 0x00
|
||||
|
||||
#define ITCL_LIBRARY_RESOURCES 3000
|
||||
#define ITK_LIBRARY_RESOURCES 3500
|
||||
|
||||
resource 'vers' (1) {
|
||||
ITCL_MAJOR_VERSION, MINOR_VERSION,
|
||||
RELEASE_LEVEL, 0x00, verUS,
|
||||
ITK_PATCH_LEVEL,
|
||||
ITK_PATCH_LEVEL ", by Michael McLennan © 1993-1998" "\n" "Lucent Technologies, Inc."
|
||||
};
|
||||
|
||||
resource 'vers' (2) {
|
||||
ITCL_MAJOR_VERSION, MINOR_VERSION,
|
||||
RELEASE_LEVEL, 0x00, verUS,
|
||||
ITK_PATCH_LEVEL,
|
||||
"ItkWish " ITK_PATCH_LEVEL " © 1993-1998"
|
||||
};
|
||||
|
||||
|
||||
#define ITCL_LIBRARY_RESOURCES 2000
|
||||
#define ITK_LIBRARY_RESOURCES 3500
|
||||
/*
|
||||
* The -16397 string will be displayed by Finder when a user
|
||||
* tries to open the shared library. The string should
|
||||
* give the user a little detail about the library's capabilities
|
||||
* and enough information to install the library in the correct location.
|
||||
* A similar string should be placed in all shared libraries.
|
||||
*/
|
||||
resource 'STR ' (-16397, purgeable) {
|
||||
"Itk Library\n\n"
|
||||
"This is the library needed to run add Itcl to the Tcl/Tk shell. "
|
||||
"To work properly, it should be placed in the ŒTool Command Language¹ folder "
|
||||
"within the Extensions folder."
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* We now load the Tk library into the resource fork of the library.
|
||||
*/
|
||||
|
||||
#include "itkMacTclCode.r"
|
||||
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+12, "itk:tclIndex", purgeable)
|
||||
"::mac:tclIndex";
|
||||
data 'TEXT' (ITK_LIBRARY_RESOURCES+13,"pkgIndex",purgeable, preload) {
|
||||
"# Tcl package index file, version 1.0\n"
|
||||
"package ifneeded Itk 3.0 [list package require Itcl 3.0 \; load [file join $dir itk30[info sharedlibextension]] Itk \; source -rsrc itk:tclIndex]\n"
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* itkMacTclCode.r
|
||||
*
|
||||
* This file includes the Itk code that is needed to startup Itk.
|
||||
* It is to be included either in the resource fork of the shared library, or in the
|
||||
* resource fork of the application for a statically bound application.
|
||||
*
|
||||
* Jim Ingham
|
||||
* Lucent Technologies 1996
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define ITK_LIBRARY_RESOURCES 3500
|
||||
|
||||
/*
|
||||
* We now load the Itk library into the resource fork of the application.
|
||||
*/
|
||||
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+1, "itk", purgeable)
|
||||
"::library:itk.tcl";
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+3, "Itk_Archetype", purgeable)
|
||||
"::library:Archetype.itk";
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+4, "Itk_Widget", purgeable)
|
||||
"::library:Widget.itk";
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+5, "Itk_Toplevel", purgeable)
|
||||
"::library:Toplevel.itk";
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* itkStaticApplication.r --
|
||||
*
|
||||
* This file creates resources which bind in the static version of the
|
||||
* pkgIndex tclIndex and itk's Tcl code files.
|
||||
*
|
||||
* Jim Ingham for Itcl 2.2
|
||||
*
|
||||
* Copyright (c) 1996 Lucent Technologies
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) itkStaticApplication.r 1.5 96/10/03 17:54:21
|
||||
*/
|
||||
|
||||
#include <Types.r>
|
||||
#include <SysTypes.r>
|
||||
|
||||
#define ITK_LIBRARY_RESOURCES 3500
|
||||
|
||||
#include "itkMacTclCode.r"
|
||||
|
||||
data 'TEXT' (ITK_LIBRARY_RESOURCES+6,"itk:pkgIndex",purgeable, preload) {
|
||||
"# Tcl package index file, version 1.0\n"
|
||||
"package ifneeded Itk 2.2 {load {} Itk}\n"
|
||||
};
|
||||
read 'TEXT' (ITK_LIBRARY_RESOURCES+2, "Itk:tclIndex", purgeable)
|
||||
"::mac:tclIndex";
|
||||
@@ -1,3 +0,0 @@
|
||||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itk 3.0 [list load [file join $dir itk30[info sharedlibextension]] Itk]
|
||||
@@ -1,11 +0,0 @@
|
||||
# Tcl autoload index file, version 2.0
|
||||
# This file is generated by the "auto_mkindex" command
|
||||
# and sourced to set up indexing information for one or
|
||||
# more commands. Typically each line is a command that
|
||||
# sets an element in the auto_index array, where the
|
||||
# element name is the name of a command and the value is
|
||||
# a script that loads the command.
|
||||
|
||||
set auto_index(::itk::Archetype) [list source -rsrc Itk_Archetype]
|
||||
set auto_index(::itk::Toplevel) [list source -rsrc Itk_Toplevel]
|
||||
set auto_index(::itk::Widget) [list source -rsrc Itk_Widget]
|
||||
@@ -1,418 +0,0 @@
|
||||
/*
|
||||
* tkMacAppInit.c --
|
||||
*
|
||||
* Provides a version of the Tcl_AppInit procedure for the example shell.
|
||||
*
|
||||
* Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center
|
||||
* Copyright (c) 1995-1997 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) tkMacAppInit.c 1.35 97/07/28 11:18:55
|
||||
*/
|
||||
|
||||
#include <Gestalt.h>
|
||||
#include <ToolUtils.h>
|
||||
#include <Fonts.h>
|
||||
#include <Dialogs.h>
|
||||
#include <SegLoad.h>
|
||||
#include <Traps.h>
|
||||
#include <Appearance.h>
|
||||
|
||||
#include "tk.h"
|
||||
#include "tkInt.h"
|
||||
#include "tkMacInt.h"
|
||||
#include "tclMac.h"
|
||||
|
||||
#include "itk.h"
|
||||
|
||||
/* include tclInt.h for access to namespace API */
|
||||
#include "tclInt.h"
|
||||
|
||||
#ifdef TK_TEST
|
||||
EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
#endif /* TK_TEST */
|
||||
|
||||
#ifdef TCL_TEST
|
||||
EXTERN int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
#endif /* TCL_TEST */
|
||||
|
||||
Tcl_Interp *gStdoutInterp = NULL;
|
||||
|
||||
int TkMacConvertEvent _ANSI_ARGS_((EventRecord *eventPtr));
|
||||
|
||||
/*
|
||||
* Prototypes for functions the ANSI library needs to link against.
|
||||
*/
|
||||
short InstallConsole _ANSI_ARGS_((short fd));
|
||||
void RemoveConsole _ANSI_ARGS_((void));
|
||||
long WriteCharsToConsole _ANSI_ARGS_((char *buff, long n));
|
||||
long ReadCharsFromConsole _ANSI_ARGS_((char *buff, long n));
|
||||
extern char * __ttyname _ANSI_ARGS_((long fildes));
|
||||
short SIOUXHandleOneEvent _ANSI_ARGS_((EventRecord *event));
|
||||
|
||||
/*
|
||||
* Prototypes for functions from the tkConsole.c file.
|
||||
*/
|
||||
|
||||
EXTERN void TkConsoleCreate _ANSI_ARGS_((void));
|
||||
EXTERN int TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
|
||||
int devId, char *buffer, long size));
|
||||
/*
|
||||
* Forward declarations for procedures defined later in this file:
|
||||
*/
|
||||
|
||||
static int MacintoshInit _ANSI_ARGS_((void));
|
||||
static int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* main --
|
||||
*
|
||||
* Main program for Wish.
|
||||
*
|
||||
* Results:
|
||||
* None. This procedure never returns (it exits the process when
|
||||
* it's done
|
||||
*
|
||||
* Side effects:
|
||||
* This procedure initializes the wish world and then
|
||||
* calls Tk_Main.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
main(
|
||||
int argc, /* Number of arguments. */
|
||||
char **argv) /* Array of argument strings. */
|
||||
{
|
||||
char *newArgv[2];
|
||||
|
||||
if (MacintoshInit() != TCL_OK) {
|
||||
Tcl_Exit(1);
|
||||
}
|
||||
|
||||
argc = 1;
|
||||
newArgv[0] = "itkwish";
|
||||
newArgv[1] = NULL;
|
||||
Tk_Main(argc, newArgv, Tcl_AppInit);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_AppInit --
|
||||
*
|
||||
* This procedure performs application-specific initialization.
|
||||
* Most applications, especially those that incorporate additional
|
||||
* packages, will have their own version of this procedure.
|
||||
*
|
||||
* Results:
|
||||
* Returns a standard Tcl completion code, and leaves an error
|
||||
* message in interp->result if an error occurs.
|
||||
*
|
||||
* Side effects:
|
||||
* Depends on the startup script.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_AppInit(
|
||||
Tcl_Interp *interp) /* Interpreter for application. */
|
||||
{
|
||||
if (Tcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tk_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
|
||||
|
||||
/*
|
||||
* Call the init procedures for included packages. Each call should
|
||||
* look like this:
|
||||
*
|
||||
* if (Mod_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* where "Mod" is the name of the module.
|
||||
*/
|
||||
|
||||
#ifdef TCL_TEST
|
||||
if (Tcltest_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
|
||||
(Tcl_PackageInitProc *) NULL);
|
||||
if (TclObjTest_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#endif /* TCL_TEST */
|
||||
|
||||
#ifdef TK_TEST
|
||||
if (Tktest_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
|
||||
(Tcl_PackageInitProc *) NULL);
|
||||
#endif /* TK_TEST */
|
||||
|
||||
/*
|
||||
* Call Tcl_CreateCommand for application-specific commands, if
|
||||
* they weren't already created by the init procedures called above.
|
||||
* Each call would look like this:
|
||||
*
|
||||
* Tcl_CreateCommand(interp, "tclName", CFuncCmd, NULL, NULL);
|
||||
*/
|
||||
if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Itk_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Itcl", Itcl_Init, Itcl_SafeInit);
|
||||
Tcl_StaticPackage(interp, "Itk", Itk_Init, (Tcl_PackageInitProc *) NULL);
|
||||
|
||||
/*
|
||||
* This is itkwish, so import all [incr Tcl] commands by
|
||||
* default into the global namespace. Fix up the autoloader
|
||||
* to do the same.
|
||||
*/
|
||||
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
|
||||
"::itk::*", /* allowOverwrite */ 1) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
|
||||
"::itcl::*", /* allowOverwrite */ 1) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itcl::* ::itk::* }") != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
SetupMainInterp(interp);
|
||||
|
||||
/*
|
||||
* Specify a user-specific startup script to invoke if the application
|
||||
* is run interactively. On the Mac we can specifiy either a TEXT resource
|
||||
* which contains the script or the more UNIX like file location
|
||||
* may also used. (I highly recommend using the resource method.)
|
||||
*/
|
||||
|
||||
Tcl_SetVar(interp, "tcl_rcRsrcName", "itkwishrc", TCL_GLOBAL_ONLY);
|
||||
/* Tcl_SetVar(interp, "tcl_rcFileName", "~/.itkwishrc", TCL_GLOBAL_ONLY); */
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* MacintoshInit --
|
||||
*
|
||||
* This procedure calls Mac specific initilization calls. Most of
|
||||
* these calls must be made as soon as possible in the startup
|
||||
* process.
|
||||
*
|
||||
* Results:
|
||||
* Returns TCL_OK if everything went fine. If it didn't the
|
||||
* application should probably fail.
|
||||
*
|
||||
* Side effects:
|
||||
* Inits the application.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
MacintoshInit()
|
||||
{
|
||||
int i;
|
||||
long result, mask = 0x0700; /* mask = system 7.x */
|
||||
|
||||
#if GENERATING68K && !GENERATINGCFM
|
||||
SetApplLimit(GetApplLimit() - (TK_MAC_68K_STACK_GROWTH));
|
||||
#endif
|
||||
MaxApplZone();
|
||||
for (i = 0; i < 4; i++) {
|
||||
(void) MoreMasters();
|
||||
}
|
||||
|
||||
/*
|
||||
* Tk needs us to set the qd pointer it uses. This is needed
|
||||
* so Tk doesn't have to assume the availablity of the qd global
|
||||
* variable. Which in turn allows Tk to be used in code resources.
|
||||
*/
|
||||
tcl_macQdPtr = &qd;
|
||||
|
||||
/*
|
||||
* If appearance is present, then register Tk as an Appearance client
|
||||
* This means that the mapping from non-Appearance to Appearance cdefs
|
||||
* will be done for Tk regardless of the setting in the Appearance
|
||||
* control panel.
|
||||
*/
|
||||
|
||||
if (TkMacHaveAppearance()) {
|
||||
RegisterAppearanceClient();
|
||||
}
|
||||
|
||||
InitGraf(&tcl_macQdPtr->thePort);
|
||||
InitFonts();
|
||||
InitWindows();
|
||||
InitMenus();
|
||||
InitDialogs((long) NULL);
|
||||
InitCursor();
|
||||
|
||||
/*
|
||||
* Make sure we are running on system 7 or higher
|
||||
*/
|
||||
|
||||
if ((NGetTrapAddress(_Gestalt, ToolTrap) ==
|
||||
NGetTrapAddress(_Unimplemented, ToolTrap))
|
||||
|| (((Gestalt(gestaltSystemVersion, &result) != noErr)
|
||||
|| (result < mask)))) {
|
||||
panic("Tcl/Tk requires System 7 or higher.");
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure we have color quick draw
|
||||
* (this means we can't run on 68000 macs)
|
||||
*/
|
||||
|
||||
if (((Gestalt(gestaltQuickdrawVersion, &result) != noErr)
|
||||
|| (result < gestalt32BitQD13))) {
|
||||
panic("Tk requires Color QuickDraw.");
|
||||
}
|
||||
|
||||
|
||||
FlushEvents(everyEvent, 0);
|
||||
SetEventMask(everyEvent);
|
||||
|
||||
|
||||
Tcl_MacSetEventProc(TkMacConvertEvent);
|
||||
TkConsoleCreate();
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* SetupMainInterp --
|
||||
*
|
||||
* This procedure calls initalization routines require a Tcl
|
||||
* interp as an argument. This call effectively makes the passed
|
||||
* iterpreter the "main" interpreter for the application.
|
||||
*
|
||||
* Results:
|
||||
* Returns TCL_OK if everything went fine. If it didn't the
|
||||
* application should probably fail.
|
||||
*
|
||||
* Side effects:
|
||||
* More initilization.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
SetupMainInterp(
|
||||
Tcl_Interp *interp)
|
||||
{
|
||||
/*
|
||||
* Initialize the console only if we are running as an interactive
|
||||
* application.
|
||||
*/
|
||||
|
||||
TkMacInitAppleEvents(interp);
|
||||
TkMacInitMenus(interp);
|
||||
|
||||
if (strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "1")
|
||||
== 0) {
|
||||
if (TkConsoleInit(interp) == TCL_ERROR) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach the global interpreter to tk's expected global console
|
||||
*/
|
||||
|
||||
gStdoutInterp = interp;
|
||||
|
||||
return TCL_OK;
|
||||
|
||||
error:
|
||||
panic(interp->result);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* InstallConsole, RemoveConsole, etc. --
|
||||
*
|
||||
* The following functions provide the UI for the console package.
|
||||
* Users wishing to replace SIOUX with their own console package
|
||||
* need only provide the four functions below in a library.
|
||||
*
|
||||
* Results:
|
||||
* See SIOUX documentation for details.
|
||||
*
|
||||
* Side effects:
|
||||
* See SIOUX documentation for details.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
short
|
||||
InstallConsole(short fd)
|
||||
{
|
||||
#pragma unused (fd)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
RemoveConsole(void)
|
||||
{
|
||||
}
|
||||
|
||||
long
|
||||
WriteCharsToConsole(char *buffer, long n)
|
||||
{
|
||||
TkConsolePrint(gStdoutInterp, TCL_STDOUT, buffer, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
long
|
||||
ReadCharsFromConsole(char *buffer, long n)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern char *
|
||||
__ttyname(long fildes)
|
||||
{
|
||||
static char *__devicename = "null device";
|
||||
|
||||
if (fildes >= 0 && fildes <= 2) {
|
||||
return (__devicename);
|
||||
}
|
||||
|
||||
return (0L);
|
||||
}
|
||||
|
||||
short
|
||||
SIOUXHandleOneEvent(EventRecord *event)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itk @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] Itk]
|
||||
@@ -1,8 +1,11 @@
|
||||
# This file contains a top-level script to run all of the Tcl
|
||||
# tests. Execute it by invoking "source all" when running tclTest
|
||||
# in this directory.
|
||||
#
|
||||
# SCCS: @(#) all 1.7 96/02/16 08:55:38
|
||||
# ------------------------------------------------------------------
|
||||
# THIS SCRIPT IS NOW DEPRECATED! It is kept for older Tcl
|
||||
# installations that don't have the "tcltest" package.
|
||||
# Instead, use the "all.tcl" script to run the test suite.
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
foreach i [lsort [glob *.test]] {
|
||||
if [string match l.*.test $i] {
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
# all.tcl --
|
||||
#
|
||||
# This file contains a top-level script to run all of the Tcl
|
||||
# tests. Execute it by invoking "source all.test" when running tcltest
|
||||
# in this directory.
|
||||
#
|
||||
# Copyright (c) 1998-2000 by Ajuba Solutions
|
||||
# All rights reserved.
|
||||
|
||||
package require tcltest 2.1
|
||||
|
||||
tcltest::testsDirectory [file dir [info script]]
|
||||
tcltest::runAllTests
|
||||
|
||||
return
|
||||
+7
-2
@@ -8,8 +8,11 @@
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# SCCS: @(#) defs 1.44 96/10/08 17:26:58
|
||||
# ------------------------------------------------------------------
|
||||
# THIS SCRIPT IS NOW DEPRECATED! It is kept for older Tcl
|
||||
# installations that don't have the "tcltest" package.
|
||||
# Instead, use "package require tcltest" in the test suite.
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
if ![info exists VERBOSE] {
|
||||
set VERBOSE 0
|
||||
@@ -80,6 +83,8 @@ if {[info commands memory] == ""} {
|
||||
# unixExecs - 1 means this machine has commands such as 'cat',
|
||||
# 'echo' etc available.
|
||||
|
||||
package require Itk
|
||||
|
||||
catch {unset testConfig}
|
||||
if {$tcl_platform(platform) == "unix"} {
|
||||
set testConfig(unixOnly) 1
|
||||
|
||||
+13
-7
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: interp.test,v 1.1 1998/07/27 18:45:31 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Make sure that slave interpreters can be created and loaded
|
||||
@@ -27,13 +29,14 @@ test interp-1.1 {create a slave interp with [incr Tk]} {
|
||||
list [slave eval "namespace children :: ::itk"] [interp delete slave]
|
||||
} {::itk {}}
|
||||
|
||||
test interp-1.2 {can't load [incr Tk] into a safe interp} {
|
||||
interp create -safe slave
|
||||
test interp-1.2 {can load [incr Tk] into a safe interp} {
|
||||
safe::interpCreate slave
|
||||
safe::loadTk slave
|
||||
load "" Itcl slave
|
||||
set result [list [catch {load "" Itk slave} msg] $msg]
|
||||
interp delete slave
|
||||
safe::interpDelete slave
|
||||
set result
|
||||
} {1 {can't use package in a safe interpreter: no Itk_SafeInit procedure}}
|
||||
} {0 {}}
|
||||
|
||||
test interp-1.3 {errors are okay when slave interp is deleted} {
|
||||
interp create slave
|
||||
@@ -46,3 +49,6 @@ test interp-1.3 {errors are okay when slave interp is deleted} {
|
||||
}
|
||||
interp delete slave
|
||||
} {}
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
+11
-6
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: option.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Component option processing
|
||||
@@ -115,15 +117,15 @@ test option-2.1 {create a widget for the following tests} {
|
||||
} {.testUsual}
|
||||
|
||||
test option-2.2 {register some "usual" code} {
|
||||
usual TestOptComp-test {keep -cursor -foreground}
|
||||
itk::usual TestOptComp-test {keep -cursor -foreground}
|
||||
} {}
|
||||
|
||||
test option-2.3 {query back "usual" code} {
|
||||
usual TestOptComp-test
|
||||
itk::usual TestOptComp-test
|
||||
} {keep -cursor -foreground}
|
||||
|
||||
test option-2.4 {query back unknown "usual" code} {
|
||||
usual xyzzyxyzzy
|
||||
itk::usual xyzzyxyzzy
|
||||
} {}
|
||||
|
||||
test option-2.5 {add a component using "usual" code} {
|
||||
@@ -177,3 +179,6 @@ foreach widget {button canvas checkbutton entry frame label listbox
|
||||
# Clean up
|
||||
# ----------------------------------------------------------------------
|
||||
itcl::delete class TestOptComp TestOptWidget
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
+8
-3
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: privacy.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Define a base class with public variables and a simple mega-widget
|
||||
@@ -92,3 +94,6 @@ test privacy-1.7 {components are visible depending on namespace context} {
|
||||
# Clean up
|
||||
# ----------------------------------------------------------------------
|
||||
itcl::delete class TestPrivacy TestMorePrivacy
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
+8
-3
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: public.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Define a base class with public variables and a simple mega-widget
|
||||
@@ -73,3 +75,6 @@ test public-1.4 {config code gets fired off} {
|
||||
# Clean up
|
||||
# ----------------------------------------------------------------------
|
||||
itcl::delete class TestPublic test_public_base
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
+126
-4
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: toplevel.test,v 1.1 1998/07/27 18:45:33 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Toplevel mega-widget
|
||||
@@ -52,7 +54,7 @@ test toplevel-1.1 {define a toplevel mega-widget class} {
|
||||
|
||||
test toplevel-1.2 {check the list of configuration options} {
|
||||
.testToplevel0 configure
|
||||
} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-takefocus takeFocus TakeFocus 0 0} {-text text Text {} {}} {-title title Title {} {}}}
|
||||
} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-menu menu Menu {} {}} {-takefocus takeFocus TakeFocus 0 0} {-text text Text {} {}} {-title title Title {} {}}}
|
||||
|
||||
test toplevel-1.3 {check the list components} {
|
||||
lsort [.testToplevel0 component]
|
||||
@@ -74,7 +76,127 @@ test toplevel-1.6 {when a mega-widget is destroyed, its object is deleted} {
|
||||
itcl::find objects .testToplevel*
|
||||
} {}
|
||||
|
||||
test toplevel-1.7 {when an mega-widget object is deleted, its window and any
|
||||
components are destroyed } {
|
||||
TestToplevel .delme
|
||||
set label [.delme component test1]
|
||||
itcl::delete object .delme
|
||||
list [winfo exists .delme] [winfo exists $label]
|
||||
} {0 0}
|
||||
|
||||
test toplevel-1.8 {when a mega-widget object is deleted, its window and any
|
||||
components are destroyed (even if in another window) } {
|
||||
catch {destroy .t1}
|
||||
catch {destroy .t2}
|
||||
catch {rename .t2 {}}
|
||||
catch {itcl::delete class ButtonTop}
|
||||
|
||||
itcl::class ButtonTop {
|
||||
inherit itk::Toplevel
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
itk_component add button {
|
||||
button $itk_option(-container).b -text Button
|
||||
} {}
|
||||
pack $itk_component(button)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
ButtonTop .t2 -container .t1
|
||||
set button [.t2 component button]
|
||||
itcl::delete object .t2
|
||||
set result [list $button [winfo exists $button]]
|
||||
itcl::delete class ButtonTop
|
||||
destroy .t1
|
||||
set result
|
||||
} {.t1.b 0}
|
||||
|
||||
test toplevel-1.9 {when a window that contains a megawidget component
|
||||
is destroyed, the component is removed from the megawidget} {
|
||||
catch {destroy .t1}
|
||||
catch {destroy .t2}
|
||||
catch {rename .t2 {}}
|
||||
catch {itcl::delete class ButtonTop}
|
||||
|
||||
itcl::class ButtonTop {
|
||||
inherit itk::Toplevel
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
itk_component add button {
|
||||
button $itk_option(-container).b -text Button
|
||||
} {}
|
||||
pack $itk_component(button)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
ButtonTop .t2 -container .t1
|
||||
set result [list [.t2 component]]
|
||||
destroy .t1
|
||||
lappend result [list [.t2 component]]
|
||||
itcl::delete object .t2
|
||||
itcl::delete class ButtonTop
|
||||
set result
|
||||
} {{button hull} hull}
|
||||
|
||||
test toplevel-1.10 {when destroying a component that is inside another
|
||||
window protect against that case where one component destroy
|
||||
actually destroys other contained components} {
|
||||
catch {destroy .t1}
|
||||
catch {destroy .t2}
|
||||
catch {rename .t2 {}}
|
||||
catch {itcl::delete class ButtonTop}
|
||||
|
||||
itcl::class ButtonTop {
|
||||
inherit itk::Toplevel
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
# Note, the component names matter here since
|
||||
# [.t2 component] returns names in hash order.
|
||||
# We need to delete cframe first since it
|
||||
# is the parent of cbutton.
|
||||
|
||||
itk_component add cframe {
|
||||
button $itk_option(-container).cframe
|
||||
} {}
|
||||
pack $itk_component(cframe)
|
||||
|
||||
itk_component add cbutton {
|
||||
button $itk_component(cframe).b -text Button
|
||||
} {}
|
||||
pack $itk_component(cbutton)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
ButtonTop .t2 -container .t1
|
||||
set result [list [.t2 component]]
|
||||
# destructor should destroy cframe but not cbutton
|
||||
itcl::delete object .t2
|
||||
lappend result [winfo exists .t1.cframe]
|
||||
destroy .t1
|
||||
itcl::delete class ButtonTop
|
||||
set result
|
||||
} {{hull cframe cbutton} 0}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Clean up
|
||||
# ----------------------------------------------------------------------
|
||||
itcl::delete class TestToplevel
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
+156
-6
@@ -5,15 +5,17 @@
|
||||
# Bell Labs Innovations for Lucent Technologies
|
||||
# mmclennan@lucent.com
|
||||
# http://www.tcltk.com/itcl
|
||||
#
|
||||
# RCS: $Id: widget.test,v 1.1 1998/07/27 18:45:33 stanton Exp $
|
||||
# ----------------------------------------------------------------------
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
# ======================================================================
|
||||
# See the file "license.terms" for information on usage and
|
||||
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
if {[string compare test [info procs test]] == 1} then {source defs}
|
||||
package require tcltest
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
::tcltest::loadTestedCommands
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Simple mega-widget
|
||||
@@ -157,7 +159,7 @@ test widget-1.10 {check the invocation of "config" code} {
|
||||
} {{} {test message}}
|
||||
|
||||
test widget-1.11a {configure using the "code" command} {
|
||||
.testWidget0 do {configure -command [code $this action "button press"]}
|
||||
.testWidget0 do {configure -command [itcl::code $this action "button press"]}
|
||||
.testWidget0 cget -command
|
||||
} {namespace inscope ::TestWidget {::.testWidget0 action {button press}}}
|
||||
|
||||
@@ -204,7 +206,7 @@ test widget-1.16 {dead components are removed from the component list} {
|
||||
} {hull test1 test2}
|
||||
|
||||
test widget-1.17 {use "configbody" command to change "config" code} {
|
||||
configbody TestWidget::status {lappend status "new"}
|
||||
itcl::configbody TestWidget::status {lappend status "new"}
|
||||
} {}
|
||||
|
||||
test widget-1.18 {"config" code can really change} {
|
||||
@@ -215,7 +217,7 @@ test widget-1.18 {"config" code can really change} {
|
||||
} {new new}
|
||||
|
||||
test widget-1.19 {"config" code can change back} {
|
||||
configbody TestWidget::status {lappend status $itk_option(-status)}
|
||||
itcl::configbody TestWidget::status {lappend status $itk_option(-status)}
|
||||
} {}
|
||||
|
||||
test widget-1.20 {mega-widgets show up on the object list} {
|
||||
@@ -237,7 +239,155 @@ test widget-1.23 {when an object is deleted the widget is destroyed} {
|
||||
winfo exists .testWidget0
|
||||
} {0}
|
||||
|
||||
test widget-1.24 {recreate another test widget} {
|
||||
TestWidget .testWidget
|
||||
} {.testWidget}
|
||||
|
||||
test widget-1.25 {when an internal component is destroyed, it is removed from the list of components, and any dead options disappear} {
|
||||
list [lsort [.testWidget component]] \
|
||||
[.testWidget configure] \
|
||||
[catch {destroy [.testWidget component test1]}] \
|
||||
[.testWidget component] \
|
||||
[.testWidget do {return [lsort [array names itk_component]]}] \
|
||||
[.testWidget configure]
|
||||
} {{hull test1 test2} {{-background background Background linen linen} {-borderwidth borderWidth BorderWidth 2 2} {-clientdata clientData ClientData {} {}} {-command command Command {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-highlight highlight Foreground white white} {-normal normal Background ivory ivory} {-status status Status {} {}} {-text text Text {} {}}} 0 {hull test2} {hull test2} {{-background background Background linen linen} {-borderwidth borderWidth BorderWidth 2 2} {-clientdata clientData ClientData {} {}} {-command command Command {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-highlight highlight Foreground white white} {-normal normal Background ivory ivory} {-status status Status {} {}}}}
|
||||
|
||||
test widget-1.26 {when an internal component is deleted (but not destroyed) it is disconnected from the option list and its binding tags are updated} {
|
||||
set comp [.testWidget component test2]
|
||||
list [bindtags $comp] \
|
||||
[bind itk-destroy-$comp <Destroy>] \
|
||||
[catch {.testWidget do {itk_component delete test2}}] \
|
||||
[bindtags $comp] \
|
||||
[bind itk-destroy-$comp <Destroy>] \
|
||||
[.testWidget configure]
|
||||
} {{itk-destroy-.testWidget.t2 .testWidget.t2 Button . all} {namespace inscope ::itk::Archetype {::.testWidget itk_component delete test2}} 0 {.testWidget.t2 Button . all} {} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-status status Status {} {}}}}
|
||||
|
||||
test widget-1.27 {when a mega-widget object is deleted, its window and any
|
||||
components are destroyed (even if in another window) } {
|
||||
catch {destroy .t1}
|
||||
catch {rename .t1.bw {}}
|
||||
catch {itcl::delete class ButtonWidget}
|
||||
|
||||
itcl::class ButtonWidget {
|
||||
inherit itk::Widget
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
itk_component add button {
|
||||
button $itk_option(-container).b -text Button
|
||||
} {}
|
||||
pack $itk_component(button)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
frame .t1.f
|
||||
ButtonWidget .t1.bw -container .t1.f
|
||||
|
||||
pack .t1.f
|
||||
pack .t1.bw
|
||||
|
||||
set button [.t1.bw component button]
|
||||
itcl::delete object .t1.bw
|
||||
set result [list $button [winfo exists $button]]
|
||||
destroy .t1
|
||||
itcl::delete class ButtonWidget
|
||||
set result
|
||||
} {.t1.f.b 0}
|
||||
|
||||
test widget-1.28 {when a window that contains a megawidget component
|
||||
is destroyed, the component is removed from the megawidget} {
|
||||
catch {destroy .t1}
|
||||
catch {rename .t1.bw {}}
|
||||
catch {itcl::delete class ButtonWidget}
|
||||
|
||||
itcl::class ButtonWidget {
|
||||
inherit itk::Widget
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
itk_component add button {
|
||||
button $itk_option(-container).b -text Button
|
||||
} {}
|
||||
pack $itk_component(button)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
frame .t1.f
|
||||
ButtonWidget .t1.bw -container .t1.f
|
||||
|
||||
pack .t1.f
|
||||
pack .t1.bw
|
||||
set result [list [.t1.bw component]]
|
||||
destroy .t1.f
|
||||
lappend result [list [.t1.bw component]]
|
||||
|
||||
itcl::delete object .t1.bw
|
||||
destroy .t1
|
||||
itcl::delete class ButtonWidget
|
||||
set result
|
||||
} {{button hull} hull}
|
||||
|
||||
test widget-1.29 {when destroying a component that is inside another
|
||||
window protect against that case where one component destroy
|
||||
actually destroys other contained components} {
|
||||
catch {destroy .t1}
|
||||
catch {rename .t1.bw {}}
|
||||
catch {itcl::delete class ButtonWidget}
|
||||
|
||||
itcl::class ButtonWidget {
|
||||
inherit itk::Widget
|
||||
|
||||
constructor {args} {
|
||||
eval itk_initialize $args
|
||||
|
||||
# Note, the component names matter here since
|
||||
# [.t2 component] returns names in hash order.
|
||||
# We need to delete cframe first since it
|
||||
# is the parent of cbutton.
|
||||
|
||||
itk_component add cframe {
|
||||
button $itk_option(-container).cframe
|
||||
} {}
|
||||
pack $itk_component(cframe)
|
||||
|
||||
itk_component add cbutton {
|
||||
button $itk_component(cframe).b -text Button
|
||||
} {}
|
||||
pack $itk_component(cbutton)
|
||||
}
|
||||
|
||||
itk_option define -container container Container {}
|
||||
}
|
||||
|
||||
toplevel .t1
|
||||
frame .t1.f
|
||||
ButtonWidget .t1.bw -container .t1.f
|
||||
|
||||
pack .t1.f
|
||||
pack .t1.bw
|
||||
set result [list [.t1.bw component]]
|
||||
# destructor should destroy cframe but not cbutton
|
||||
itcl::delete object .t1.bw
|
||||
lappend result [winfo exists .t1.f.cframe]
|
||||
|
||||
destroy .t1
|
||||
itcl::delete class ButtonWidget
|
||||
set result
|
||||
} {{hull cframe cbutton} 0}
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Clean up
|
||||
# ----------------------------------------------------------------------
|
||||
itcl::delete class TestWidget
|
||||
|
||||
::tcltest::cleanupTests
|
||||
exit
|
||||
|
||||
@@ -1,326 +0,0 @@
|
||||
#
|
||||
# This file is a Makefile for [incr Tk]. If it has the name
|
||||
# "Makefile.in" 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.
|
||||
#
|
||||
# RCS: $Id: Makefile.in,v 1.2 1998/08/11 14:41:03 welch Exp $
|
||||
|
||||
# Current [incr Tcl] version; used in various names.
|
||||
|
||||
MAJOR_VERSION = @ITCL_MAJOR_VERSION@
|
||||
MINOR_VERSION = @ITCL_MINOR_VERSION@
|
||||
RELEASE_LEVEL = @ITCL_RELEASE_LEVEL@
|
||||
VERSION = @ITCL_VERSION@
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# Things you can change to personalize the Makefile for your own
|
||||
# site (you can make these changes in either Makefile.in or
|
||||
# Makefile, but changes to Makefile will get lost if you re-run
|
||||
# the configuration script).
|
||||
#----------------------------------------------------------------
|
||||
|
||||
# Default top-level directories in which to install architecture-
|
||||
# specific files (exec_prefix) and machine-independent files such
|
||||
# as scripts (prefix). The values specified here may be overridden
|
||||
# at configure-time with the --exec-prefix and --prefix options
|
||||
# to the "configure" script.
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
# The following definition can be set to non-null for special systems
|
||||
# like AFS with replication. It allows the pathnames used for installation
|
||||
# to be different than those used for actually reference files at
|
||||
# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
|
||||
# when installing files.
|
||||
INSTALL_ROOT =
|
||||
|
||||
# Directory from which applications will reference the library of Tcl
|
||||
# scripts (note: you can set the ITK_LIBRARY environment variable at
|
||||
# run-time to override the compiled-in location):
|
||||
ITK_LIBRARY = $(prefix)/lib/itk$(VERSION)
|
||||
|
||||
# Path name to use when installing library scripts:
|
||||
SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(ITK_LIBRARY)
|
||||
|
||||
# Directory in which to install the archive libitk.a:
|
||||
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
|
||||
|
||||
# Path to use at runtime to refer to LIB_INSTALL_DIR:
|
||||
LIB_RUNTIME_DIR = $(exec_prefix)/lib
|
||||
|
||||
# Directory in which to install the program wish:
|
||||
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
|
||||
|
||||
# Directory in which to install the include file itk.h:
|
||||
INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
|
||||
|
||||
# Top-level directory for manual entries:
|
||||
MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
|
||||
|
||||
# Directory in which to install manual entry for wish:
|
||||
MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1
|
||||
|
||||
# Directory in which to install manual entries for Tk's C library
|
||||
# procedures:
|
||||
MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3
|
||||
|
||||
# Directory in which to install manual entries for the built-in
|
||||
# Tcl commands implemented by Tk:
|
||||
MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann
|
||||
|
||||
# The directory containing the Tcl sources and headers appropriate
|
||||
# for this version of [incr Tk]:
|
||||
TCL_SRC_DIR = @TCL_SRC_DIR@
|
||||
|
||||
# The directory containing the Tcl library archive file appropriate
|
||||
# for this version of [incr Tk]:
|
||||
TCL_LIB_DIR = @TCL_LIB_DIR@
|
||||
|
||||
# Library flags for Tcl library
|
||||
TCL_LIB_FLAG = @TCL_LIB_FLAG@
|
||||
|
||||
# Tcl libraries built with optimization switches have this additional extension
|
||||
DBGX = @TCL_DBGX@
|
||||
|
||||
# The directory containing the Tk sources and headers appropriate
|
||||
# for this version of [incr Tk]:
|
||||
TK_SRC_DIR = @TK_SRC_DIR@
|
||||
|
||||
# The directory containing the Tk library archive file appropriate
|
||||
# for this version of [incr Tk]:
|
||||
TK_LIB_DIR = @TK_LIB_DIR@
|
||||
|
||||
# Library flags for Tk library
|
||||
TK_LIB_FLAG = @TK_LIB_FLAG@
|
||||
|
||||
# The directory containing the [incr Tcl] sources and headers appropriate
|
||||
# for this version of [incr Tk]:
|
||||
ITCL_SRC_DIR = @ITCL_SRC_DIR@
|
||||
|
||||
# The directory containing the [incr Tcl] library archive file appropriate
|
||||
# for this version of [incr Tk]:
|
||||
ITCL_LIB_DIR = @ITCL_LIB_DIR@
|
||||
|
||||
# A "-I" switch that can be used when compiling to make all of the
|
||||
# X11 include files accessible (the configure script will try to
|
||||
# set this value, and will cause it to be an empty string if the
|
||||
# include files are accessible via /usr/include).
|
||||
X11_INCLUDES = @TK_XINCLUDES@
|
||||
|
||||
# Linker switch(es) to use to link with the X11 library archive (the
|
||||
# configure script will try to set this value automatically, but you
|
||||
# can override it).
|
||||
X11_LIB_SWITCHES = @TK_XLIBSW@
|
||||
|
||||
# Libraries to use when linking: must include at least Tk, Tcl, Xlib,
|
||||
# and the math library (in that order). The "LIBS" part will be
|
||||
# replaced (or has already been replaced) with relevant libraries as
|
||||
# determined by the configure script.
|
||||
LIBS = @TK_LIB_SPEC@ $(X11_LIB_SWITCHES) \
|
||||
@ITCL_BUILD_LIB_SPEC@ @TCL_LIB_SPEC@ \
|
||||
@TCL_LIBS@ @DL_LIBS@ -lc
|
||||
|
||||
# To change the compiler switches, for example to change from -O
|
||||
# to -g, change the following line:
|
||||
CFLAGS = @CFLAGS@
|
||||
|
||||
# To disable ANSI-C procedure prototypes reverse the comment characters
|
||||
# on the following lines:
|
||||
PROTO_FLAGS =
|
||||
#PROTO_FLAGS = -DNO_PROTOTYPE
|
||||
|
||||
# To enable memory debugging reverse the comment characters on the following
|
||||
# lines. Warning: if you enable memory debugging, you must do it
|
||||
# *everywhere*, including all the code that calls Tcl, and you must use
|
||||
# ckalloc and ckfree everywhere instead of malloc and free.
|
||||
MEM_DEBUG_FLAGS =
|
||||
#MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG
|
||||
|
||||
# If your X server is X11R4 or earlier, then you may wish to reverse
|
||||
# the comment characters on the following two lines. This will enable
|
||||
# extra code to speed up XStringToKeysym. In X11R5 and later releases
|
||||
# XStringToKeysym is plenty fast, so you needn't define REDO_KEYSYM_LOOKUP.
|
||||
KEYSYM_FLAGS =
|
||||
#KEYSYM_FLAGS = -DREDO_KEYSYM_LOOKUP
|
||||
|
||||
# Some versions of make, like SGI's, use the following variable to
|
||||
# determine which shell to use for executing commands:
|
||||
SHELL = /bin/sh
|
||||
|
||||
# Tk used to let the configure script choose which program to use
|
||||
# for installing, but there are just too many different versions of
|
||||
# "install" around; better to use the install-sh script that comes
|
||||
# with the distribution, which is slower but guaranteed to work.
|
||||
|
||||
INSTALL = $(TOP_DIR)/../config/install-sh -c
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
MKINSTALLDIRS = $(TOP_DIR)/../config/mkinstalldirs
|
||||
|
||||
# The symbols below provide support for dynamic loading and shared
|
||||
# libraries. The values of the symbols are normally set by the
|
||||
# configure script. You shouldn't normally need to modify any of
|
||||
# these definitions by hand.
|
||||
|
||||
SHLIB_CFLAGS = @SHLIB_CFLAGS@
|
||||
|
||||
LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
|
||||
|
||||
ITK_LIB_FILE = @ITK_LIB_FILE@
|
||||
#ITK_LIB_FILE = libitk.a
|
||||
|
||||
# The symbol below provides support for dynamic loading and shared
|
||||
# libraries. See configure.in for a description of what it means.
|
||||
# The values of the symbolis normally set by the configure script.
|
||||
|
||||
SHLIB_LD = @SHLIB_LD@
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# The information below is modified by the configure script when
|
||||
# Makefile is generated from Makefile.in. You shouldn't normally
|
||||
# modify any of this stuff by hand.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
AC_FLAGS = @TCL_DEFS@
|
||||
RANLIB = @RANLIB@
|
||||
TOP_DIR = @ITK_SRC_DIR@
|
||||
GENERIC_DIR = $(TOP_DIR)/generic
|
||||
UNIX_DIR = $(TOP_DIR)/unix
|
||||
|
||||
#----------------------------------------------------------------
|
||||
# The information below should be usable as is. The configure
|
||||
# script won't modify it and you shouldn't need to modify it
|
||||
# either.
|
||||
#----------------------------------------------------------------
|
||||
|
||||
|
||||
CC = @CC@
|
||||
CC_SWITCHES = $(CFLAGS) $(SHLIB_CFLAGS) -I$(UNIX_DIR) -I$(GENERIC_DIR) \
|
||||
-I$(TCL_SRC_DIR)/generic -I$(ITCL_SRC_DIR)/generic \
|
||||
-I$(TK_SRC_DIR)/generic $(X11_INCLUDES) \
|
||||
$(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) \
|
||||
-DITK_LIBRARY=\"$(ITK_LIBRARY)\"
|
||||
|
||||
OBJS = itk_cmds.o itk_option.o itk_archetype.o itk_util.o
|
||||
|
||||
SRCS = $(GENERIC_DIR)/itk_cmds.c $(GENERIC_DIR)/itk_option.c \
|
||||
$(GENERIC_DIR)/itk_archetype.c $(GENERIC_DIR)/itk_util.c
|
||||
|
||||
all: itkwish
|
||||
|
||||
# The following target is configured by autoconf to generate either
|
||||
# a shared library or non-shared library for [incr Tk].
|
||||
|
||||
@ITK_LIB_FILE@: ${OBJS}
|
||||
rm -f $(ITK_LIB_FILE)
|
||||
@MAKE_LIB@
|
||||
$(RANLIB) $(ITK_LIB_FILE)
|
||||
|
||||
itkwish: tkAppInit.o $(ITK_LIB_FILE)
|
||||
$(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
|
||||
$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish
|
||||
|
||||
# Note, in the target below TCL_LIBRARY needs to be set or else
|
||||
# "make test" won't work in the case where the compilation directory
|
||||
# isn't the same as the source directory.
|
||||
|
||||
test: itkwish
|
||||
TCLLIBPATH="`pwd` $(TK_LIB_DIR) $(ITCL_LIB_DIR) $(TCL_LIB_DIR)"; export TCLLIBPATH; \
|
||||
LD_LIBRARY_PATH=`pwd`:$(ITCL_LIB_DIR):$(TK_LIB_DIR):$(TCL_LIB_DIR):$(LD_LIBRARY_PATH); export LD_LIBRARY_PATH; \
|
||||
TCL_LIBRARY=$(TCL_SRC_DIR)/library; export TCL_LIBRARY; \
|
||||
TK_LIBRARY=$(TK_SRC_DIR)/library; export TK_LIBRARY; \
|
||||
ITCL_LIBRARY=$(ITCL_SRC_DIR)/library; export ITCL_LIBRARY; \
|
||||
ITK_LIBRARY=$(TOP_DIR)/library; export ITK_LIBRARY; \
|
||||
( echo cd $(TOP_DIR)/tests\; source all\; exit ) \
|
||||
| ./itkwish -geometry +0+0
|
||||
|
||||
install: install-binaries install-libraries install-man
|
||||
|
||||
install-binaries: $(ITK_LIB_FILE) itkwish
|
||||
@$(MKINSTALLDIRS) $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR)
|
||||
@echo "Installing $(ITK_LIB_FILE)"
|
||||
@$(INSTALL_DATA) $(ITK_LIB_FILE) $(LIB_INSTALL_DIR)
|
||||
@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(ITK_LIB_FILE))
|
||||
@chmod 555 $(LIB_INSTALL_DIR)/$(ITK_LIB_FILE)
|
||||
@echo "Installing itkwish"
|
||||
$(INSTALL_PROGRAM) itkwish $(BIN_INSTALL_DIR)/itkwish$(VERSION)
|
||||
@echo "Installing itkConfig.sh"
|
||||
@$(INSTALL_DATA) itkConfig.sh $(LIB_INSTALL_DIR)/itkConfig.sh
|
||||
|
||||
install-libraries:
|
||||
@$(MKINSTALLDIRS) $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)
|
||||
@echo "Installing itk.h"
|
||||
@$(INSTALL_DATA) $(GENERIC_DIR)/itk.h $(INCLUDE_INSTALL_DIR)
|
||||
@for i in $(TOP_DIR)/library/*.* $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \
|
||||
do \
|
||||
echo "Installing $$i"; \
|
||||
$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
|
||||
done;
|
||||
@echo "Installing pkgIndex.tcl"
|
||||
@$(INSTALL_DATA) pkgIndex.tcl $(SCRIPT_INSTALL_DIR)
|
||||
|
||||
install-man:
|
||||
@$(MKINSTALLDIRS) $(MAN1_INSTALL_DIR) $(MANN_INSTALL_DIR)
|
||||
@cd $(TOP_DIR)/doc; for i in *.1; \
|
||||
do \
|
||||
echo "Installing doc/$$i"; \
|
||||
rm -f $(MAN1_INSTALL_DIR)/$$i; \
|
||||
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
|
||||
$$i > $(MAN1_INSTALL_DIR)/$$i; \
|
||||
chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
|
||||
done;
|
||||
@cd $(TOP_DIR)/doc; for i in *.n; \
|
||||
do \
|
||||
echo "Installing doc/$$i"; \
|
||||
rm -f $(MANN_INSTALL_DIR)/$$i; \
|
||||
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
|
||||
$$i > $(MANN_INSTALL_DIR)/$$i; \
|
||||
chmod 444 $(MANN_INSTALL_DIR)/$$i; \
|
||||
done;
|
||||
|
||||
Makefile: $(UNIX_DIR)/Makefile.in
|
||||
$(SHELL) config.status
|
||||
|
||||
clean:
|
||||
rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors \
|
||||
rm -f itkwish* libitk* *pure* *% ../tests/core
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile config.status config.log config.cache pkgIndex.tcl
|
||||
|
||||
pure: tkAppInit.o $(ITK_LIB_FILE)
|
||||
purify $(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
|
||||
$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure
|
||||
|
||||
profile: tkAppInit.o $(ITK_LIB_FILE)
|
||||
quantify $(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
|
||||
$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure
|
||||
|
||||
depend:
|
||||
makedepend -- $(CC_SWITCHES) -- $(SRCS)
|
||||
|
||||
configure: configure.in
|
||||
autoconf
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CC_SWITCHES) $<
|
||||
|
||||
tkAppInit.o: $(UNIX_DIR)/tkAppInit.c Makefile
|
||||
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkAppInit.c
|
||||
|
||||
itk_cmds.o: $(GENERIC_DIR)/itk_cmds.c Makefile
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_cmds.c
|
||||
|
||||
itk_option.o: $(GENERIC_DIR)/itk_option.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_option.c
|
||||
|
||||
itk_archetype.o: $(GENERIC_DIR)/itk_archetype.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_archetype.c
|
||||
|
||||
itk_util.o: $(GENERIC_DIR)/itk_util.c
|
||||
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_util.c
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
@@ -1,248 +0,0 @@
|
||||
dnl This file is an input file used by the GNU "autoconf" program to
|
||||
dnl generate the file "configure", which is run during Tk installation
|
||||
dnl to configure the system for the local environment.
|
||||
|
||||
AC_INIT(../generic/itk.h)
|
||||
# RCS: $Id: configure.in,v 1.2 1998/08/11 14:41:04 welch Exp $
|
||||
|
||||
ITCL_VERSION=3.0
|
||||
ITCL_MAJOR_VERSION=3
|
||||
ITCL_MINOR_VERSION=0
|
||||
ITCL_RELEASE_LEVEL=0
|
||||
VERSION=${ITCL_VERSION}
|
||||
|
||||
AC_CONFIG_AUX_DIR(../../config)
|
||||
AC_PREREQ(2.0)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# Set up a new default --prefix. If a previous installation of
|
||||
# [incr Tcl] can be found searching $PATH use that directory.
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
AC_PREFIX_DEFAULT(/usr/local)
|
||||
AC_PREFIX_PROGRAM(tclsh)
|
||||
|
||||
if test "${prefix}" = "NONE"; then
|
||||
prefix=/usr/local
|
||||
fi
|
||||
if test "${exec_prefix}" = "NONE"; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
BUILD_DIR=`pwd`
|
||||
ITK_SRC_DIR=`cd $srcdir/..; pwd`
|
||||
cd ${BUILD_DIR}
|
||||
|
||||
AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
|
||||
[itk_ok=$enableval], [itk_ok=no])
|
||||
if test "$itk_ok" = "yes"; then
|
||||
AC_PROG_CC
|
||||
else
|
||||
CC=${CC-cc}
|
||||
AC_SUBST(CC)
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# See if there was a command-line option for where Tcl is; if
|
||||
# not, search for Tcl.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.0 binaries from DIR],
|
||||
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tcl8.0*/unix`)
|
||||
|
||||
TCL_LIB_DIR=""
|
||||
for dir in $exec_prefix/lib $itcl_search ; do
|
||||
if test -r $dir/tclConfig.sh; then
|
||||
TCL_LIB_DIR=$dir
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$TCL_LIB_DIR"; then
|
||||
AC_MSG_ERROR(Can't find Tcl libraries. Use --with-tcl to specify the directory containing tclConfig.sh on your system.)
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Read in configuration information generated by Tcl for shared
|
||||
# libraries, and arrange for it to be substituted into our
|
||||
# Makefile.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
file=$TCL_LIB_DIR/tclConfig.sh
|
||||
. $file
|
||||
CFLAGS=$TCL_CFLAGS
|
||||
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
|
||||
SHLIB_LD=$TCL_SHLIB_LD
|
||||
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
|
||||
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
|
||||
DL_LIBS=$TCL_DL_LIBS
|
||||
LD_FLAGS=$TCL_LD_FLAGS
|
||||
LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Make sure that we can find the Tcl sources, so we can include
|
||||
# the "tclInt.h" file.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
if test ! -d "$TCL_SRC_DIR"; then
|
||||
AC_MSG_ERROR(Can't find Tcl source directory "$TCL_SRC_DIR". Itcl can't be built without this directory.)
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# See if there was a command-line option for where Tk is; if
|
||||
# not, search for Tk.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.0 binaries from DIR],
|
||||
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tk8.0*/unix`)
|
||||
|
||||
TK_LIB_DIR=""
|
||||
for dir in $exec_prefix/lib $itcl_search ; do
|
||||
if test -r $dir/tkConfig.sh; then
|
||||
TK_LIB_DIR=$dir
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$TK_LIB_DIR"; then
|
||||
AC_MSG_ERROR(Can't find Tk libraries. Use --with-tk to specify the directory containing tkConfig.sh on your system.)
|
||||
fi
|
||||
|
||||
file=$TK_LIB_DIR/tkConfig.sh
|
||||
. $file
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# See if there was a command-line option for where [incr Tcl] is.
|
||||
# If not, assume that its top-level directory is a sibling of ours.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_ARG_WITH(itcl, [ --with-itcl=DIR use Itcl 3.0 binaries from DIR],
|
||||
ITCL_LIB_DIR=$withval, ITCL_LIB_DIR=`cd ../../itcl/unix; pwd`)
|
||||
|
||||
if test ! -r "$ITCL_LIB_DIR/itclConfig.sh"; then
|
||||
AC_MSG_ERROR(Can't find Itcl libraries. Have you built Itcl yet? Use --with-itcl to specify the directory containing itclConfig.sh on your system.)
|
||||
fi
|
||||
|
||||
file=$ITCL_LIB_DIR/itclConfig.sh
|
||||
. $file
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# If this is gcc, add some extra compile flags.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_MSG_CHECKING([whether C compiler is gcc])
|
||||
AC_CACHE_VAL(itcl_cv_prog_gcc,
|
||||
AC_EGREP_CPP(_cc_is_gcc_, [
|
||||
#ifdef __GNUC__
|
||||
_cc_is_gcc_
|
||||
#endif
|
||||
], [itcl_cv_prog_gcc=yes], [itcl_cv_prog_gcc=no]))
|
||||
AC_MSG_RESULT([$itcl_cv_prog_gcc])
|
||||
|
||||
if test -z "$CFLAGS" ; then
|
||||
CFLAGS="-O"
|
||||
fi
|
||||
if test "$itcl_cv_prog_gcc" = "yes" ; then
|
||||
CFLAGS="$CFLAGS -Wshadow -Wtraditional -Wall"
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([default compiler flags])
|
||||
AC_ARG_WITH(cflags, [ --with-cflags=FLAGS set compiler flags to FLAGS],
|
||||
[CFLAGS="$with_cflags"])
|
||||
|
||||
AC_MSG_RESULT([$CFLAGS])
|
||||
|
||||
if test "$TCL_CC" != "$CC" ; then
|
||||
echo ""
|
||||
echo "WARNING: Compiler is $CC but Tcl was compiled with $TCL_CC"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# The statements below define a collection of symbols related to
|
||||
# building libitk as a shared library instead of a static library.
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_ARG_ENABLE(shared,
|
||||
[ --enable-shared build libitk as a shared library],
|
||||
[ok=$enableval], [ok=no])
|
||||
if test "$ok" = "yes"; then
|
||||
if test ${TCL_SHARED_BUILD} = 0; then
|
||||
AC_MSG_ERROR(Tcl was not built with --enable-shared, so you can't use shared libraries.)
|
||||
fi
|
||||
SHLIB_CFLAGS="${SHLIB_CFLAGS}"
|
||||
eval "ITK_LIB_FILE=libitk${VERSION}${SHLIB_SUFFIX}"
|
||||
ITK_PKG_FILE="[[file join [file dirname \$dir] ${ITK_LIB_FILE}]]"
|
||||
MAKE_LIB="\$(SHLIB_LD) -o ${ITK_LIB_FILE} \$(OBJS) ${SHLIB_LD_LIBS} \$(LD_SEARCH_FLAGS)"
|
||||
RANLIB=":"
|
||||
else
|
||||
SHLIB_CFLAGS=""
|
||||
eval "ITK_LIB_FILE=libitk${VERSION}.a"
|
||||
ITK_PKG_FILE=""
|
||||
MAKE_LIB="ar cr ${ITK_LIB_FILE} \${OBJS}"
|
||||
fi
|
||||
|
||||
# Note: in the following variable, it's important to use the absolute
|
||||
# path name of the Tcl directory rather than "..": this is because
|
||||
# AIX remembers this path and will attempt to use it at run-time to look
|
||||
# up the Tcl library.
|
||||
|
||||
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
|
||||
ITK_BUILD_LIB_SPEC="-L`pwd` -litk${VERSION}"
|
||||
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk${VERSION}"
|
||||
else
|
||||
ITK_BUILD_LIB_SPEC="-L`pwd` -litk`echo ${VERSION} | tr -d .`"
|
||||
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk`echo ${VERSION} | tr -d .`"
|
||||
fi
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(DL_LIBS)
|
||||
AC_SUBST(LD_FLAGS)
|
||||
AC_SUBST(MAKE_LIB)
|
||||
AC_SUBST(SHLIB_CFLAGS)
|
||||
AC_SUBST(SHLIB_LD)
|
||||
AC_SUBST(SHLIB_LD_LIBS)
|
||||
AC_SUBST(SHLIB_SUFFIX)
|
||||
AC_SUBST(LD_SEARCH_FLAGS)
|
||||
|
||||
AC_SUBST(TCL_VERSION)
|
||||
AC_SUBST(TCL_SRC_DIR)
|
||||
AC_SUBST(TCL_LIB_SPEC)
|
||||
AC_SUBST(TCL_LIB_FLAG)
|
||||
AC_SUBST(TCL_DBGX)
|
||||
AC_SUBST(TCL_DEFS)
|
||||
AC_SUBST(TCL_LIBS)
|
||||
AC_SUBST(TCL_SHLIB_LD_LIBS)
|
||||
AC_SUBST(TCL_SHLIB_SUFFIX)
|
||||
AC_SUBST(TCL_COMPAT_OBJS)
|
||||
|
||||
AC_SUBST(TK_VERSION)
|
||||
AC_SUBST(TK_BUILD_LIB_SPEC)
|
||||
AC_SUBST(TK_LIB_DIR)
|
||||
AC_SUBST(TK_LIB_SPEC)
|
||||
AC_SUBST(TK_LIB_FLAG)
|
||||
AC_SUBST(TK_XINCLUDES)
|
||||
AC_SUBST(TK_XLIBSW)
|
||||
AC_SUBST(TK_SRC_DIR)
|
||||
|
||||
AC_SUBST(ITCL_VERSION)
|
||||
AC_SUBST(ITCL_MAJOR_VERSION)
|
||||
AC_SUBST(ITCL_MINOR_VERSION)
|
||||
AC_SUBST(ITCL_RELEASE_LEVEL)
|
||||
AC_SUBST(ITCL_BUILD_LIB_SPEC)
|
||||
AC_SUBST(ITCL_LIB_DIR)
|
||||
AC_SUBST(ITCL_LIB_SPEC)
|
||||
AC_SUBST(ITCL_PKG_FILE)
|
||||
AC_SUBST(ITCL_SRC_DIR)
|
||||
|
||||
AC_SUBST(ITK_BUILD_LIB_SPEC)
|
||||
AC_SUBST(ITK_LIB_FILE)
|
||||
AC_SUBST(ITK_LIB_SPEC)
|
||||
AC_SUBST(ITK_PKG_FILE)
|
||||
AC_SUBST(ITK_SRC_DIR)
|
||||
|
||||
AC_OUTPUT(Makefile pkgIndex.tcl itkConfig.sh)
|
||||
@@ -1,36 +0,0 @@
|
||||
# itkConfig.sh --
|
||||
#
|
||||
# This shell script (for sh) is generated automatically by Itk's
|
||||
# configure script. It will create shell variables for most of
|
||||
# the configuration options discovered by the configure script.
|
||||
# This script is intended to be included by the configure scripts
|
||||
# for Itk extensions so that they don't have to figure this all
|
||||
# out for themselves. This file does not duplicate information
|
||||
# already provided by tclConfig.sh, tkConfig.sh or itclConfig.sh,
|
||||
# so you may need to use those files in addition to this one.
|
||||
#
|
||||
# The information in this file is specific to a single platform.
|
||||
|
||||
# Itcl's version number.
|
||||
ITCL_VERSION='3.0'
|
||||
ITCL_MAJOR_VERSION='3'
|
||||
ITCL_MINOR_VERSION='0'
|
||||
|
||||
# The name of the Itk library (may be either a .a file or a shared library):
|
||||
ITK_LIB_FILE=libitk3.0.so
|
||||
|
||||
# String to pass to linker to pick up the Itk library from its
|
||||
# build directory.
|
||||
ITK_BUILD_LIB_SPEC='-L/home/mmc/itcl/itcl3.0/itk/unix -litk3.0'
|
||||
|
||||
# String to pass to linker to pick up the Itk library from its
|
||||
# installed directory.
|
||||
ITK_LIB_SPEC='-L/tmp/itcl/lib -litk3.0'
|
||||
|
||||
# Location of the top-level source directories from which [incr Tk]
|
||||
# was built. This is the directory that contains a README file as well
|
||||
# as subdirectories such as generic, unix, etc. If [incr Tk] was
|
||||
# compiled in a different place than the directory containing the source
|
||||
# files, this points to the location of the sources, not the location
|
||||
# where [incr Tk] was compiled.
|
||||
ITK_SRC_DIR='/home/mmc/itcl/itcl3.0/itk'
|
||||
@@ -1,3 +0,0 @@
|
||||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itk @ITCL_VERSION@ [list load "@ITK_PKG_FILE@" Itk]
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* tkAppInit.c --
|
||||
*
|
||||
* Provides a default version of the Tcl_AppInit procedure for
|
||||
* use in wish and similar Tk-based applications.
|
||||
*
|
||||
* Copyright (c) 1993 The Regents of the University of California.
|
||||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*
|
||||
* SCCS: @(#) tkAppInit.c 1.22 96/05/29 09:47:08
|
||||
*/
|
||||
|
||||
#include "tk.h"
|
||||
#include "itk.h"
|
||||
|
||||
/* include tclInt.h for access to namespace API */
|
||||
#include "tclInt.h"
|
||||
|
||||
/*
|
||||
* The following variable is a special hack that is needed in order for
|
||||
* Sun shared libraries to be used for Tcl.
|
||||
*/
|
||||
|
||||
extern int matherr();
|
||||
int *tclDummyMathPtr = (int *) matherr;
|
||||
|
||||
#ifdef TK_TEST
|
||||
EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
|
||||
#endif /* TK_TEST */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* main --
|
||||
*
|
||||
* This is the main program for the application.
|
||||
*
|
||||
* Results:
|
||||
* None: Tk_Main never returns here, so this procedure never
|
||||
* returns either.
|
||||
*
|
||||
* Side effects:
|
||||
* Whatever the application does.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc; /* Number of command-line arguments. */
|
||||
char **argv; /* Values of command-line arguments. */
|
||||
{
|
||||
Tk_Main(argc, argv, Tcl_AppInit);
|
||||
return 0; /* Needed only to prevent compiler warning. */
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_AppInit --
|
||||
*
|
||||
* This procedure performs application-specific initialization.
|
||||
* Most applications, especially those that incorporate additional
|
||||
* packages, will have their own version of this procedure.
|
||||
*
|
||||
* Results:
|
||||
* Returns a standard Tcl completion code, and leaves an error
|
||||
* message in interp->result if an error occurs.
|
||||
*
|
||||
* Side effects:
|
||||
* Depends on the startup script.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_AppInit(interp)
|
||||
Tcl_Interp *interp; /* Interpreter for application. */
|
||||
{
|
||||
if (Tcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tk_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
|
||||
#ifdef TK_TEST
|
||||
if (Tktest_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
|
||||
(Tcl_PackageInitProc *) NULL);
|
||||
#endif /* TK_TEST */
|
||||
|
||||
|
||||
/*
|
||||
* Call the init procedures for included packages. Each call should
|
||||
* look like this:
|
||||
*
|
||||
* if (Mod_Init(interp) == TCL_ERROR) {
|
||||
* return TCL_ERROR;
|
||||
* }
|
||||
*
|
||||
* where "Mod" is the name of the module.
|
||||
*/
|
||||
if (Itcl_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Itk_Init(interp) == TCL_ERROR) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_StaticPackage(interp, "Itcl", Itcl_Init, Itcl_SafeInit);
|
||||
Tcl_StaticPackage(interp, "Itk", Itk_Init, (Tcl_PackageInitProc *) NULL);
|
||||
|
||||
/*
|
||||
* This is itkwish, so import all [incr Tcl] commands by
|
||||
* default into the global namespace. Fix up the autoloader
|
||||
* to do the same.
|
||||
*/
|
||||
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
|
||||
"::itk::*", /* allowOverwrite */ 1) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
|
||||
"::itcl::*", /* allowOverwrite */ 1) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itcl::* ::itk::* }") != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call Tcl_CreateCommand for application-specific commands, if
|
||||
* they weren't already created by the init procedures called above.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Specify a user-specific startup file to invoke if the application
|
||||
* is run interactively. Typically the startup file is "~/.apprc"
|
||||
* where "app" is the name of the application. If this line is deleted
|
||||
* then no user-specific startup file will be run under any conditions.
|
||||
*/
|
||||
|
||||
Tcl_SetVar(interp, "tcl_rcFileName", "~/.itkwishrc", TCL_GLOBAL_ONLY);
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -7,7 +7,16 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#if defined(_MSC_VER)
|
||||
/* Only do this when MSVC++ is compiling us. */
|
||||
# define DllEntryPoint DllMain
|
||||
# if defined(USE_TCL_STUBS) && (!defined(_MT) || !defined(_DLL) || defined(_DEBUG))
|
||||
/*
|
||||
* This fixes a bug with how the Stubs library was compiled.
|
||||
* The requirement for msvcrt.lib from tclstubXX.lib should
|
||||
* be removed.
|
||||
*/
|
||||
# pragma comment(linker, "-nodefaultlib:msvcrt.lib")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
-227
@@ -1,227 +0,0 @@
|
||||
# Borland C++ 4.52 makefile
|
||||
#
|
||||
# Copyright (c) 1993-1996 Lucent Technologies
|
||||
# based on original from
|
||||
# Copyright (c) 1995-1996 by Sun Microsystems, Inc.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
!include "..\..\Makefile.bc"
|
||||
|
||||
#
|
||||
# Project directories
|
||||
#
|
||||
# ROOT = top of source tree
|
||||
# TMPDIR = location where .obj files should be stored during build
|
||||
|
||||
ROOT = ..
|
||||
TMPDIR = .
|
||||
TARGET_LIB_ITK = $(TARGET_LIB)\Itk2.2
|
||||
TARGET_DOC_ITK = $(TARGET_DOC)\Itk
|
||||
|
||||
# uncomment the following line to compile with symbols
|
||||
#DEBUG=1
|
||||
|
||||
# uncomment the following two lines to compile with TCL_MEM_DEBUG
|
||||
#DEBUGDEFINES =TCL_MEM_DEBUG
|
||||
|
||||
|
||||
INCLUDES =$(BORLAND)\include;$(ROOT)\generic;$(ROOT);$(TCLDIR)\generic;$(ITCLDIR)\generic;$(TKDIR)\generic;$(TKDIR)\xlib;$(TKDIR)\bitmaps
|
||||
LIBDIRS =$(BORLAND)\lib;$(ROOT)\win
|
||||
|
||||
!ifndef DEBUG
|
||||
|
||||
# these macros cause maximum optimization and no symbols
|
||||
DEBUGLDFLAGS =
|
||||
DEBUGCCFLAGS = -v- -vi- -O2
|
||||
|
||||
!else
|
||||
|
||||
# these macros enable debugging
|
||||
DEBUGLDFLAGS = -v
|
||||
DEBUGCCFLAGS = -k -Od -v
|
||||
|
||||
!endif
|
||||
|
||||
DEFINES = _RTLDLL;USE_TCLALLOC=0;STRICT;$(DEBUGDEFINES);ITCL_NAMESPACES=1
|
||||
PROJECTCCFLAGS= $(DEBUGCCFLAGS) -w-par -w-stu
|
||||
|
||||
LNFLAGS_exe = -Tpe -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0w32
|
||||
LNFLAGS_dll = -Tpd -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0d32
|
||||
|
||||
LNLIBS_exe = $(ITKLIB) $(ITCLLIBDIR)\$(ITCLLIB) $(TKLIBDIR)\$(TKLIB) $(TCLLIBDIR)\$(TCLLIB) import32 cw32i
|
||||
LNLIBS_dll = $(ITCLLIBDIR)\$(ITCLLIB) $(TKLIBDIR)\$(TKLIB) $(TCLLIBDIR)\$(TCLLIB) import32 cw32i
|
||||
|
||||
#
|
||||
# Global makefile settings
|
||||
#
|
||||
|
||||
.AUTODEPEND
|
||||
.CACHEAUTODEPEND
|
||||
|
||||
.suffixes: .c .dll .lib .obj .exe
|
||||
|
||||
.path.c=$(ROOT)\win;$(ROOT)\generic;
|
||||
.path.obj=$(TMPDIR)
|
||||
|
||||
ITKWISHOBJS = \
|
||||
$(TMPDIR)\winMain.obj
|
||||
|
||||
ITKOBJS = \
|
||||
$(TMPDIR)\itk_archetype.obj \
|
||||
$(TMPDIR)\itk_cmds.obj \
|
||||
$(TMPDIR)\itk_option.obj \
|
||||
$(TMPDIR)\itk_util.obj \
|
||||
$(TMPDIR)\dllEntryPoint.obj
|
||||
|
||||
ITKWISH = itkwish.exe
|
||||
|
||||
|
||||
#
|
||||
# Targets
|
||||
#
|
||||
|
||||
all: cfgdll $(ITKDLL) cfgexe $(ITKWISH) cfgcln
|
||||
test: $(ITKWISH)
|
||||
$(CP) $(TCLLIBDIR)\*.dll
|
||||
$(CP) $(TKLIBDIR)\*.dll
|
||||
$(CP) $(ITCLLIBDIR)\*.dll
|
||||
#set ITK_
|
||||
$(ITKWISH) <<|
|
||||
cd ..\tests
|
||||
source all
|
||||
exit
|
||||
|
|
||||
|
||||
install: all
|
||||
$(MKDIR) "$(TARGET_ROOT)"
|
||||
$(MKDIR) "$(TARGET_BIN)"
|
||||
$(MKDIR) "$(TARGET_LIB_ROOT)"
|
||||
$(MKDIR) "$(TARGET_LIB)"
|
||||
$(MKDIR) "$(TARGET_LIB_ITK)"
|
||||
$(MKDIR) "$(TARGET_INCLUDE_ROOT)"
|
||||
$(MKDIR) "$(TARGET_INCLUDE)"
|
||||
$(MKDIR) "$(TARGET_DOC)"
|
||||
$(MKDIR) "$(TARGET_DOC_ITK)"
|
||||
$(CP) $(TMPDIR)\$(ITKWISH) "$(TARGET_BIN)"
|
||||
$(CP) $(TMPDIR)\$(ITKDLL) "$(TARGET_BIN)"
|
||||
$(CP) $(ROOT)\generic\itk.h "$(TARGET_INCLUDE)"
|
||||
$(CP) $(ROOT)\library\*.* "$(TARGET_LIB_ITK)"
|
||||
$(CP) $(ROOT)\win\*.tcl "$(TARGET_LIB_ITK)"
|
||||
$(CP) $(ROOT)\..\html\Itk\*.* "$(TARGET_DOC_ITK)"
|
||||
|
||||
# Implicit Targets
|
||||
|
||||
.c.obj:
|
||||
@$(BCC32) {$< }
|
||||
|
||||
.dll.lib:
|
||||
$(IMPLIB) -c $@ $<
|
||||
|
||||
.rc.res:
|
||||
$(RC) -i$(ROOT)\generic;$(ITCLDIR)\generic;$(TCLDIR)\generic;$(TKDIR)\generic $<
|
||||
|
||||
#
|
||||
# Special case object file targets
|
||||
#
|
||||
|
||||
#
|
||||
# Configuration file targets - these files are implicitly used by the compiler
|
||||
#
|
||||
|
||||
cfgdll:
|
||||
@$(CP) &&|
|
||||
-n$(TMPDIR) -I$(INCLUDES) -c -WD
|
||||
-D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
|
||||
| bcc32.cfg >NUL
|
||||
|
||||
cfgexe:
|
||||
@$(CP) &&|
|
||||
-n$(TMPDIR) -I$(INCLUDES) -c -W
|
||||
-D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
|
||||
| bcc32.cfg >NUL
|
||||
|
||||
cfgtest:
|
||||
@$(CP) &&|
|
||||
-n$(TMPDIR) -I$(INCLUDES) -c -W
|
||||
-D$(DEFINES);TCL_TEST -3 -d $(PROJECTCCFLAGS)
|
||||
| bcc32.cfg >NUL
|
||||
|
||||
cfgcln:
|
||||
@$(RM) bcc32.cfg
|
||||
|
||||
#
|
||||
# Executable targets
|
||||
#
|
||||
|
||||
$(ITKDLL): $(ITKOBJS) itk.def rc\itk.res
|
||||
$(TLINK32) @&&|
|
||||
$(LNFLAGS_dll) $(ITKOBJS)
|
||||
$@
|
||||
-x
|
||||
$(LNLIBS_dll)
|
||||
itk.def
|
||||
rc\itk.res
|
||||
|
|
||||
|
||||
$(ITKWISH): $(ITKWISHOBJS) $(ITKLIB) rc\itkwish.res
|
||||
$(TLINK32) @&&|
|
||||
$(LNFLAGS_exe) $(ITKWISHOBJS)
|
||||
$@
|
||||
-x
|
||||
$(LNLIBS_exe)
|
||||
|, &&|
|
||||
EXETYPE WINDOWS
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|, rc\itkwish.res
|
||||
|
||||
#
|
||||
# Other dependencies
|
||||
#
|
||||
|
||||
|
||||
# The following rule automatically generates a tk.def file containing
|
||||
# an export entry for every public symbol in the $(TKDLL) library.
|
||||
|
||||
itk.def: $(ITKOBJS)
|
||||
$(TCLLIBDIR)\dumpexts.exe -o $@ $(ITKDLL) @&&|
|
||||
$(ITKOBJS)
|
||||
|
|
||||
|
||||
# Dependencies for .rc files:
|
||||
rc\itk.res: rc\*.cur rc\itk.ico
|
||||
rc\itkwish.res: rc\*.cur rc\itk.ico
|
||||
|
||||
# debugging rules, the .dll and .exe files must be in the same
|
||||
# directory as the object files for debugging purposes
|
||||
|
||||
$(TMPDIR)\$(ITKDLL): $(ITKDLL)
|
||||
$(CP) $(ITKDLL) $(TMPDIR)
|
||||
|
||||
$(TMPDIR)\$(ITCLDLL): $(ITCLLIBDIR)\$(ITCLDLL)
|
||||
$(CP) $(ITCLLIBDIR)\$(ITCLDLL) $(TMPDIR)
|
||||
|
||||
$(TMPDIR)\$(TKDLL): $(TKLIBDIR)\$(TKDLL)
|
||||
$(CP) $(TKLIBDIR)\$(TKDLL) $(TMPDIR)
|
||||
|
||||
$(TMPDIR)\$(TCLDLL): $(TCLLIBDIR)\$(TCLDLL)
|
||||
$(CP) $(TCLLIBDIR)\$(TCLDLL) $(TMPDIR)
|
||||
|
||||
$(TMPDIR)\$(ITKWISH): $(ITKWISH)
|
||||
$(CP) $(ITKWISH) $(TMPDIR)
|
||||
|
||||
debug: $(TMPDIR)\$(ITKDLL) $(TMPDIR)\$(ITCLDLL) $(TMPDIR)\$(TKDLL) $(TMPDIR)\$(TCLDLL)
|
||||
|
||||
|
||||
# remove all generated files
|
||||
|
||||
clean:
|
||||
-@$(RM) $(ITKWISH)
|
||||
-@$(RM) $(ITKLIB)
|
||||
-@$(RM) $(ITKDLL)
|
||||
-@$(RM) itk.def
|
||||
-@$(RM) $(TMPDIR)\Rc\*.res
|
||||
-@$(RM) $(TMPDIR)\*.obj
|
||||
-@$(RM) *.cfg
|
||||
+422
-203
@@ -1,267 +1,486 @@
|
||||
# Visual C++ 2.x and 4.0 makefile
|
||||
#------------------------------------------------------------------------------
|
||||
# Visual C++ 5.0+ makefile for [Incr Tk]
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
# SCCS: @(#) makefile.vc 1.8 98/07/29 13:14:52
|
||||
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
|
||||
#------------------------------------------------------------------------------
|
||||
# Do not modify this file!
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Does not depend on the presence of any environment variables in
|
||||
# order to compile tcl; all needed information is derived from
|
||||
# location of the compiler directories.
|
||||
#
|
||||
# NOTE: Be sure to modify the "makefile.vc" file in the toplevel directory
|
||||
# for the itcl distribution. Include the location of your VC++ development
|
||||
# tools and the installation directory.
|
||||
!if !exist("makefile.vc")
|
||||
MSG = ^
|
||||
You must run this makefile only from the directory it is in.^
|
||||
Please `cd` to its location first.
|
||||
!error $(MSG)
|
||||
!endif
|
||||
|
||||
!include "..\..\makefile.vc"
|
||||
PROJECT = itk
|
||||
!include "rules.vc"
|
||||
|
||||
|
||||
# ROOT = top of source tree
|
||||
#
|
||||
# TMPDIR = location where .obj files should be stored during build
|
||||
!if $(TCLINSTALL)
|
||||
!message *** Warning: [Incr Tk] requires the source distribution of Tcl to build from,
|
||||
!message *** at this time, sorry. Please set the TCLDIR and TKDIR macros to point
|
||||
!message *** to the sources.
|
||||
!endif
|
||||
|
||||
ROOT = ..
|
||||
ITCLDIR = ..\..\itcl
|
||||
ITCLDIR = ..\..\itcl
|
||||
|
||||
######################################################################
|
||||
# Do not modify below this line
|
||||
######################################################################
|
||||
|
||||
ITKNAMEPREFIX = itk
|
||||
WISHNAMEPREFIX = itkwish
|
||||
VERSION = 30
|
||||
DOTVERSION = 3.0
|
||||
!if [nmakehlp -g $(ITCLDIR)\generic\itcl.h ITCL_VERSION] == 33
|
||||
ITCL_DOTVERSION = 3.3
|
||||
!elseif [nmakehlp -g $(ITCLDIR)\generic\itcl.h ITCL_VERSION] == 34
|
||||
ITCL_DOTVERSION = 3.4
|
||||
!elseif [nmakehlp -g $(ITCLDIR)\generic\itcl.h ITCL_VERSION] == 35
|
||||
ITCL_DOTVERSION = 3.5
|
||||
!elseif [nmakehlp -g $(ITCLDIR)\generic\itcl.h ITCL_VERSION] == 0
|
||||
MSG =^
|
||||
Can't get version string from ..\generic\itcl.h
|
||||
!error $(MSG)
|
||||
!endif
|
||||
ITCL_VERSION = $(ITCL_DOTVERSION:.=)
|
||||
|
||||
!if [nmakehlp -g ..\generic\itk.h ITK_VERSION] == 33
|
||||
ITK_DOTVERSION = 3.3
|
||||
!elseif [nmakehlp -g ..\generic\itk.h ITK_VERSION] == 34
|
||||
ITK_DOTVERSION = 3.4
|
||||
!elseif [nmakehlp -g ..\generic\itk.h ITK_VERSION] == 35
|
||||
ITK_DOTVERSION = 3.5
|
||||
!elseif [nmakehlp -g ..\generic\itk.h ITK_VERSION] == 0
|
||||
MSG =^
|
||||
Can't get version string from ..\generic\itk.h
|
||||
!error $(MSG)
|
||||
!endif
|
||||
ITK_VERSION = $(ITK_DOTVERSION:.=)
|
||||
|
||||
|
||||
BINROOT = .
|
||||
!IF "$(NODEBUG)" == "1"
|
||||
TMPDIR = $(BINROOT)\Release
|
||||
DBGX =
|
||||
!ELSE
|
||||
TMPDIR = $(BINROOT)\Debug
|
||||
DBGX = d
|
||||
!ENDIF
|
||||
OUTDIR = $(TMPDIR)
|
||||
ROOT = ..
|
||||
STUBPREFIX = $(PROJECT)stub
|
||||
|
||||
ITKDLLNAME = $(ITKNAMEPREFIX)$(VERSION)$(DBGX).dll
|
||||
ITKDLL = $(OUTDIR)\$(ITKDLLNAME)
|
||||
ITKLIB = $(OUTDIR)\$(ITKNAMEPREFIX)$(VERSION)$(DBGX).lib
|
||||
PKGINDEX = "$(TMP_DIR)\pkgIndex.tcl"
|
||||
|
||||
ITKWISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
|
||||
DUMPEXTS = $(TMPDIR)\dumpexts.exe
|
||||
ITCLLIBNAME = itcl$(ITCL_VERSION)$(SUFX).$(EXT)
|
||||
ITCLLIB = "$(ITCLDIR)\win\$(OUT_DIR)\$(ITCLLIBNAME)"
|
||||
ITKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(ITK_VERSION)$(SUFX).lib"
|
||||
ITKSTUBLIBNAME = $(STUBPREFIX)$(ITK_VERSION).lib
|
||||
ITKSTUBLIB = "$(OUT_DIR)\$(ITKSTUBLIBNAME)"
|
||||
|
||||
LIB_INSTALL_DIR = $(INSTALLDIR)\lib
|
||||
BIN_INSTALL_DIR = $(INSTALLDIR)\bin
|
||||
SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\itk$(DOTVERSION)
|
||||
INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
|
||||
!if $(TCL_DOES_STUBS)
|
||||
ITKLIBNAME = $(PROJECT)$(ITK_VERSION)$(SUFX).$(EXT)
|
||||
ITCLIMPLIBNAME = itcl$(ITCL_VERSION)$(SUFX).$(EXT)
|
||||
!else
|
||||
ITKLIBNAME = $(PROJECT)$(ITK_VERSION)80$(SUFX).$(EXT)
|
||||
ITCLIMPLIBNAME = itcl$(ITCL_VERSION)80$(SUFX).lib
|
||||
!endif
|
||||
ITKLIB = "$(OUT_DIR)\$(ITKLIBNAME)"
|
||||
ITCLIMPLIB = "$(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLIMPLIBNAME)"
|
||||
|
||||
ITKWISHOBJS = \
|
||||
$(TMPDIR)\winMain.obj
|
||||
|
||||
!if $(TCLINSTALL)
|
||||
TKSTUBLIB = "$(TCLDIR)\lib\tkstub$(TCL_VERSION).lib"
|
||||
TKIMPLIB = "$(TCLDIR)\lib\tk$(TCL_VERSION)$(DBGX).lib"
|
||||
TKLIB = "$(TCLDIR)\bin\tk$(TCL_VERSION)$(DBGX).dll"
|
||||
WISH = "$(TCLDIR)\bin\wish$(TCL_VERSION)$(DBGX).exe"
|
||||
TCL_LIBRARY =
|
||||
TK_LIBRARY =
|
||||
!else
|
||||
TKSTUBLIB = "$(TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
|
||||
TKIMPLIB = "$(TKDIR)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).lib"
|
||||
TKLIB = "$(TKDIR)\win\$(OUT_DIR)\tk$(TCL_VERSION)$(DBGX).dll"
|
||||
WISH = "$(TKDIR)\win\$(OUT_DIR)\wish$(TCL_VERSION)$(DBGX).exe"
|
||||
TCL_LIBRARY = "$(TCLDIR)\library"
|
||||
TK_LIBRARY = "$(TKDIR)\library"
|
||||
!endif
|
||||
ITCL_LIBRARY = "$(ITCLDIR:\=/)/library"
|
||||
ITK_LIBRARY = "$(ROOT)/library"
|
||||
|
||||
ITCLSTUBLIBNAME = itclstub$(ITCL_VERSION).lib
|
||||
ITCLSTUBLIB = "$(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLSTUBLIBNAME)"
|
||||
|
||||
### For Tcl 8.0
|
||||
!if !$(TCL_DOES_STUBS)
|
||||
TCLSTUBLIB = $(TCLIMPLIB)
|
||||
TKSTUBLIB = $(TKIMPLIB)
|
||||
ITCLSTUBLIB = $(ITCLIMPLIB)
|
||||
!endif
|
||||
|
||||
|
||||
BIN_INSTALL_DIR = $(_INSTALLDIR)\bin
|
||||
DOC_INSTALL_DIR = $(_INSTALLDIR)\doc
|
||||
LIB_INSTALL_DIR = $(_INSTALLDIR)\lib
|
||||
SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\itk$(ITK_DOTVERSION)
|
||||
INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include
|
||||
|
||||
ITKOBJS = \
|
||||
$(TMPDIR)\itk_archetype.obj \
|
||||
$(TMPDIR)\itk_cmds.obj \
|
||||
$(TMPDIR)\itk_option.obj \
|
||||
$(TMPDIR)\itk_util.obj \
|
||||
$(TMPDIR)\dllEntryPoint.obj
|
||||
$(TMP_DIR)\itk_archetype.obj \
|
||||
$(TMP_DIR)\itk_cmds.obj \
|
||||
$(TMP_DIR)\itk_option.obj \
|
||||
$(TMP_DIR)\itk_util.obj \
|
||||
!if !$(STATIC_BUILD)
|
||||
$(TMP_DIR)\dllEntryPoint.obj \
|
||||
$(TMP_DIR)\itk.res \
|
||||
!endif
|
||||
!if $(TCL_DOES_STUBS)
|
||||
$(TMP_DIR)\itkStubInit.obj
|
||||
!endif
|
||||
|
||||
cc32 = $(TOOLS32)\bin\cl.exe
|
||||
link32 = $(TOOLS32)\bin\link.exe
|
||||
rc32 = $(TOOLS32_rc)\bin\rc.exe
|
||||
include32 = -I$(TOOLS32)\include
|
||||
ITKSTUBOBJS = \
|
||||
!if $(TCL_DOES_STUBS)
|
||||
$(TMP_DIR)\itkStubLib.obj
|
||||
!endif
|
||||
|
||||
WINDIR = $(ROOT)\win
|
||||
GENERICDIR = $(ROOT)\generic
|
||||
RCDIR = $(WINDIR)\rc
|
||||
DOCDIR = $(ROOT)\doc
|
||||
WINDIR = $(ROOT)\win
|
||||
RCDIR = $(ROOT)\win\rc
|
||||
TOOLSDIR = ..\..\tools
|
||||
|
||||
TCLBUILDDIR = $(TCLDIR)\win\$(OUTDIR)
|
||||
TCLLIB = $(TCLBUILDDIR)\tcl80$(DBGX).lib
|
||||
TCLDLL = $(TCLBUILDDIR)\tcl80$(DBGX).dll
|
||||
TKBUILDDIR = $(TKDIR)\win\$(OUTDIR)
|
||||
TKLIB = $(TKBUILDDIR)\tk80$(DBGX).lib
|
||||
TKDLL = $(TKBUILDDIR)\tk80$(DBGX).dll
|
||||
ITCLBUILDDIR = $(ITCLDIR)\win\$(OUTDIR)
|
||||
ITCLLIB = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).lib
|
||||
ITCLDLL = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).dll
|
||||
|
||||
ITK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) \
|
||||
-I$(TCLDIR)\generic -I$(TKDIR)\generic -I$(TKDIR)\xlib -I$(ITCLDIR)\generic
|
||||
ITK_DEFINES = -DBUILD_itk $(DEBUGDEFINES)
|
||||
|
||||
ITK_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
|
||||
$(ITK_INCLUDES) $(ITK_DEFINES)
|
||||
|
||||
######################################################################
|
||||
#---------------------------------------------------------------------
|
||||
# Link flags
|
||||
######################################################################
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!IF "$(NODEBUG)" == "1"
|
||||
ldebug = /RELEASE
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:cv
|
||||
!ENDIF
|
||||
!if $(DEBUG)
|
||||
ldebug = -debug:full -debugtype:cv
|
||||
!else
|
||||
ldebug = -release -opt:ref -opt:icf,3
|
||||
!endif
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
|
||||
lflags = -nologo -machine:$(MACHINE) $(ldebug)
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(MACHINE)" == "IX86"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
|
||||
!ELSE
|
||||
lflags = $(lcommon) /MACHINE:$(MACHINE)
|
||||
!ENDIF
|
||||
!if $(PROFILE)
|
||||
lflags = $(lflags) -profile
|
||||
!endif
|
||||
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
||||
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
|
||||
# align sections for PE size savings.
|
||||
lflags = $(lflags) -opt:nowin98
|
||||
!else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
|
||||
# align sections for speed in loading by choosing the virtual page size.
|
||||
lflags = $(lflags) -align:4096
|
||||
!endif
|
||||
|
||||
!IF "$(MACHINE)" == "PPC"
|
||||
libc = libc.lib
|
||||
libcdll = crtdll.lib
|
||||
!ELSE
|
||||
libc = libc.lib oldnames.lib
|
||||
libcdll = msvcrt.lib oldnames.lib
|
||||
!ENDIF
|
||||
!if $(LOIMPACT)
|
||||
lflags = $(lflags) -ws:aggressive
|
||||
!endif
|
||||
|
||||
baselibs = kernel32.lib $(optlibs) advapi32.lib
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
guilibs = $(libc) $(winlibs)
|
||||
ITK_LFLAGS = $(lflags) -subsystem:windows -dll
|
||||
ITK_LLIBS = $(TCLSTUBLIB) $(TKSTUBLIB) $(ITCLSTUBLIB)
|
||||
|
||||
guilibsdll = $(libcdll) $(winlibs)
|
||||
!if exist("$(TCLDIR)\win\coffbase.txt")
|
||||
ITK_DLLBASE = -base:@$(TCLDIR)\win\coffbase.txt,itk
|
||||
!else
|
||||
ITK_DLLBASE =
|
||||
!endif
|
||||
|
||||
######################################################################
|
||||
#---------------------------------------------------------------------
|
||||
# Compile flags
|
||||
######################################################################
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!IF "$(NODEBUG)" == "1"
|
||||
!IF "$(MACHINE)" == "ALPHA"
|
||||
# MSVC on Alpha doesn't understand -Ot
|
||||
cdebug = -O2i -Gs -GD
|
||||
!ELSE
|
||||
cdebug = -Oti -Gs -GD
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!if $(DEBUG)
|
||||
!if "$(MACHINE)" == "IA64"
|
||||
cdebug = -Od -Zi
|
||||
!else
|
||||
cdebug = -Z7 -Od -WX
|
||||
!ENDIF
|
||||
!endif
|
||||
!else
|
||||
# This cranks the optimization level up to max.
|
||||
cdebug = -O2
|
||||
!endif
|
||||
|
||||
# declarations common to all compiler options
|
||||
ccommon = -c -W3 -nologo -Fp$(TMPDIR)\ -YX
|
||||
cflags = -nologo -c -W3 -YX -D_USE_32BIT_TIME_T -Fp$(TMP_DIR)^\
|
||||
|
||||
!IF "$(MACHINE)" == "IX86"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
!ELSE
|
||||
!IF "$(MACHINE)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(MACHINE)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(MACHINE)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!if $(PENT_0F_ERRATA)
|
||||
cflags = $(cflags) -QI0f
|
||||
!endif
|
||||
|
||||
cvars = -DWIN32 -D_WIN32
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
!if $(ITAN_B_ERRATA)
|
||||
cflags = $(cflags) -QIA64_Bx
|
||||
!endif
|
||||
|
||||
!IF "$(NODEBUG)" == "1"
|
||||
cvarsdll = $(cvars) -MD
|
||||
!ELSE
|
||||
cvarsdll = $(cvars) -MDd
|
||||
!ENDIF
|
||||
!if $(MSVCRT)
|
||||
crt = -MD$(DBGX)
|
||||
!else
|
||||
crt = -MT$(DBGX)
|
||||
!endif
|
||||
|
||||
CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
|
||||
!if $(TCLINSTALL)
|
||||
TCL_INCLUDES = -I"$(TCLDIR)\include"
|
||||
TK_INCLUDES =
|
||||
!else
|
||||
TCL_INCLUDES = -I"$(TCLDIR)\generic" -I"$(TCLDIR)\win"
|
||||
TK_INCLUDES = -I"$(TKDIR)\generic" -I"$(TKDIR)\xlib"
|
||||
!endif
|
||||
|
||||
######################################################################
|
||||
ITK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR)
|
||||
ITCL_INCLUDES = -I"$(ITCLDIR)\generic"
|
||||
ITK_DEFINES = -DBUILD_itk -DTCL_THREADS=1
|
||||
ITK_EXE_CFLAGS = $(cdebug) $(cflags) $(crt) $(ITCL_INCLUDES) $(ITK_INCLUDES) \
|
||||
$(TCL_INCLUDES) $(TK_INCLUDES) $(ITK_DEFINES)
|
||||
|
||||
### By convention, static builds do not use Stubs. This is just a practice,
|
||||
### not a technical limitation.
|
||||
!if $(STATIC_BUILD)
|
||||
ITK_CFLAGS = $(ITK_EXE_CFLAGS) -DSTATIC_BUILD $(OPTDEFINES)
|
||||
!elseif $(TCL_DOES_STUBS)
|
||||
ITK_CFLAGS = $(ITK_EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_TK_STUBS -DUSE_ITCL_STUBS $(OPTDEFINES)
|
||||
!else
|
||||
ITK_CFLAGS = $(ITK_EXE_CFLAGS) $(OPTDEFINES)
|
||||
!endif
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Project specific targets
|
||||
######################################################################
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
all: setup $(ITKWISH)
|
||||
test: setup $(ITKWISH)
|
||||
-@copy $(TCLDLL) $(TMPDIR)
|
||||
-@copy $(TKDLL) $(TMPDIR)
|
||||
-@copy $(ITCLDLL) $(TMPDIR)
|
||||
$(ITKWISH)
|
||||
all : setup $(ITKLIB) $(ITKSTUBLIB)
|
||||
release : setup $(ITKLIB) $(ITKSTUBLIB)
|
||||
install : install-binaries install-docs
|
||||
|
||||
setup:
|
||||
if not exist $(TMPDIR) mkdir $(TMPDIR)
|
||||
if not exist $(OUTDIR) mkdir $(OUTDIR)
|
||||
|
||||
$(ITKLIB): $(ITKDLL)
|
||||
|
||||
$(ITKDLL): $(ITKOBJS) $(TMPDIR)\itk.res $(TMPDIR)\itkvc.def
|
||||
set LIB=$(TOOLS32)\lib
|
||||
$(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\itkvc.def \
|
||||
-out:$@ $(TMPDIR)\itk.res $(TCLLIB) $(TKLIB) $(ITCLLIB) \
|
||||
$(guilibsdll) @<<
|
||||
$(ITKOBJS)
|
||||
!if $(STATIC_BUILD)
|
||||
test :
|
||||
@echo test target not supported for a static library.
|
||||
!else
|
||||
test : setup $(ITKLIB) $(ITKSTUBLIB)
|
||||
$(TCLSH) ..\tests\all.tcl $(TESTFLAGS) -loadfile <<
|
||||
set env(TK_LIBRARY) $(TK_LIBRARY:\=/)
|
||||
set env(ITCL_LIBRARY) [file normalize $(ITCL_LIBRARY:\=/)]
|
||||
set env(ITK_LIBRARY) [file normalize $(ITK_LIBRARY:\=/)]
|
||||
load [file normalize $(ITCLLIB:\=/)] Itcl
|
||||
load [file normalize $(TKLIB:\=/)] Tk
|
||||
load [file normalize $(ITKLIB:\=/)] Itk
|
||||
<<
|
||||
!endif
|
||||
|
||||
$(ITKWISH): $(ITKWISHOBJS) $(ITKLIB) $(TMPDIR)\itkwish.res
|
||||
set LIB=$(TOOLS32)\lib
|
||||
$(link32) $(ldebug) $(guilflags) $(TMPDIR)\itkwish.res -out:$@ \
|
||||
$(guilibsdll) $(TCLLIB) $(TKLIB) $(ITCLLIB) $(ITKLIB) $(ITKWISHOBJS)
|
||||
setup :
|
||||
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
|
||||
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
|
||||
|
||||
$(TMPDIR)\itkvc.def: $(DUMPEXTS) $(ITKOBJS)
|
||||
$(DUMPEXTS) -o $@ $(ITKDLLNAME) @<<
|
||||
$(ITKLIB): $(ITKOBJS)
|
||||
!if $(STATIC_BUILD)
|
||||
$(lib32) -nologo -machine:$(MACHINE) -out:$@ @<<
|
||||
!else
|
||||
$(link32) $(ITK_LFLAGS) $(ITK_DLLBASE) -out:$@ $(ITK_LLIBS) @<<
|
||||
!endif
|
||||
$(ITKOBJS)
|
||||
<<
|
||||
|
||||
$(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c
|
||||
$(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
|
||||
set LIB=$(TOOLS32)\lib
|
||||
$(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \
|
||||
$(TMPDIR)\winDumpExts.obj
|
||||
|
||||
install: all
|
||||
if not exist $(INSTALLDIR) mkdir $(INSTALLDIR)
|
||||
if not exist $(BIN_INSTALL_DIR) mkdir $(BIN_INSTALL_DIR)
|
||||
if not exist $(LIB_INSTALL_DIR) mkdir $(LIB_INSTALL_DIR)
|
||||
if not exist $(SCRIPT_INSTALL_DIR) mkdir $(SCRIPT_INSTALL_DIR)
|
||||
if not exist $(INCLUDE_INSTALL_DIR) mkdir $(INCLUDE_INSTALL_DIR)
|
||||
copy $(ITKWISH) "$(BIN_INSTALL_DIR)"
|
||||
copy $(ITKDLL) "$(BIN_INSTALL_DIR)"
|
||||
!if $(TCL_DOES_STUBS)
|
||||
$(ITKSTUBLIB) : $(ITKSTUBOBJS)
|
||||
$(lib32) -nologo -out:$@ $(ITKSTUBOBJS)
|
||||
!endif
|
||||
|
||||
install-binaries:
|
||||
if not exist "$(_INSTALLDIR)" mkdir "$(_INSTALLDIR)"
|
||||
if not exist "$(BIN_INSTALL_DIR)" mkdir "$(BIN_INSTALL_DIR)"
|
||||
if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)"
|
||||
if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
|
||||
if not exist "$(INCLUDE_INSTALL_DIR)" mkdir "$(INCLUDE_INSTALL_DIR)"
|
||||
copy $(ITKLIB) "$(SCRIPT_INSTALL_DIR)"
|
||||
!if $(ITKSTUBLIB) != ""
|
||||
copy $(ITKSTUBLIB) "$(LIB_INSTALL_DIR)"
|
||||
!endif
|
||||
copy $(ROOT)\generic\itk.h "$(INCLUDE_INSTALL_DIR)"
|
||||
copy $(ROOT)\generic\itkDecls.h "$(INCLUDE_INSTALL_DIR)"
|
||||
copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)"
|
||||
copy $(ROOT)\win\*.tcl "$(SCRIPT_INSTALL_DIR)"
|
||||
echo if {[package vsatisfies 8.0 [package provide Tcl]]} {\
|
||||
> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo ^ ^ ^ ^ set add 80>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo ^ ^ ^ ^ set add {}>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo }>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo if {[info exists ::tcl_platform(debug)] ^&^&\
|
||||
$$::tcl_platform(debug) ^&^& \>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo ^ ^ ^ ^ ^ ^ ^ ^ [file exists [file join $$dir\
|
||||
$(PROJECT)$(ITK_VERSION)$${add}g.dll]]}\
|
||||
{>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo ^ ^ ^ ^ package ifneeded Itk $(ITK_DOTVERSION) [list load\
|
||||
[file join $$dir $(PROJECT)$(ITK_VERSION)$${add}g.dll]\
|
||||
Itk]>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo } else {>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo ^ ^ ^ ^ package ifneeded Itk $(ITK_DOTVERSION) [list load\
|
||||
[file join $$dir $(PROJECT)$(ITK_VERSION)$${add}.dll]\
|
||||
Itk]>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo }>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
echo unset add>> "$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
|
||||
#
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Regenerate the stubs files.
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!if !$(TCLINSTALL)
|
||||
# Only from the sources of Tcl does genStubs.tcl exist.
|
||||
genstubs:
|
||||
$(TCLSH) $(TOOLSDIR)\genStubs.tcl $(GENERICDIR) \
|
||||
$(GENERICDIR)\itk.decls
|
||||
!else
|
||||
genstubs:
|
||||
@echo ERROR: Can't rebuild stubs tables without the Tcl source distribution
|
||||
!endif
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Generate the source dependencies.
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
depend:
|
||||
!if !exist($(TCLSH))
|
||||
@echo Build tclsh first!
|
||||
!else
|
||||
$(TCLSH) $(TCLTOOLSDIR)\mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
|
||||
-passthru:"-DBUILD_itcl $(ITCL_INCLUDES) $(TCL_INCLUDES) $(ITK_INCLUDES) $(TK_INCLUDES)" \
|
||||
$(GENERICDIR),$$(GENERICDIR) $(WINDIR),$$(WINDIR) @<<
|
||||
$(ITKOBJS)
|
||||
<<
|
||||
!endif
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Dependency rules
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!if exist("$(OUT_DIR)\depend.mk")
|
||||
!include "$(OUT_DIR)\depend.mk"
|
||||
!message *** Dependency rules in use.
|
||||
!else
|
||||
!message *** Dependency rules are not being used.
|
||||
!endif
|
||||
|
||||
### add a spacer in the output
|
||||
!message
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Special case object file targets
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
$(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
|
||||
$(cc32) -DBUILD_tcl -DBUILD_tk $(ITK_CFLAGS) -Fo$@ $?
|
||||
# The following object is part of the stub library and should not
|
||||
# be built as DLL objects but none of the symbols should be exported
|
||||
|
||||
#
|
||||
# Implicit rules
|
||||
#
|
||||
$(TMP_DIR)\itkStubLib.obj : $(GENERICDIR)\itkStubLib.c
|
||||
$(cc32) -DSTATIC_BUILD $(ITK_EXE_CFLAGS) -Zl -Fo$@ $?
|
||||
|
||||
{$(GENERICDIR)}.c{$(TMPDIR)}.obj:
|
||||
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
||||
#---------------------------------------------------------------------
|
||||
# Inference rules.
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
{$(WINDIR)}.c{$(TMPDIR)}.obj:
|
||||
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
||||
{$(WINDIR)}.c{$(TMP_DIR)}.obj ::
|
||||
$(cc32) $(ITK_CFLAGS) -Fo$(TMP_DIR)\ @<<
|
||||
$<
|
||||
<<
|
||||
|
||||
{$(ROOT)\unix}.c{$(TMPDIR)}.obj:
|
||||
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
|
||||
{$(GENERICDIR)}.c{$(TMP_DIR)}.obj ::
|
||||
$(cc32) $(ITK_CFLAGS) -Fo$(TMP_DIR)\ @<<
|
||||
$<
|
||||
<<
|
||||
|
||||
{$(RCDIR)}.rc{$(TMPDIR)}.res:
|
||||
$(rc32) -fo $@ -r -i $(GENERICDIR) -i $(TCLDIR)\generic -i $(ITCLDIR)\generic $<
|
||||
{$(RCDIR)}.rc{$(TMP_DIR)}.res :
|
||||
$(rc32) -fo $@ -DDEBUG=$(DEBUG) $(ITK_INCLUDES) $(TCL_INCLUDES) $(ITCL_INCLUDES) $(ITK_DEFINES) $<
|
||||
|
||||
clean:
|
||||
-@del $(OUTDIR)\*.exp
|
||||
-@del $(OUTDIR)\*.lib
|
||||
-@del $(OUTDIR)\*.dll
|
||||
-@del $(OUTDIR)\*.exe
|
||||
-@del $(OUTDIR)\*.pdb
|
||||
-@del $(TMPDIR)\*.pch
|
||||
-@del $(TMPDIR)\*.obj
|
||||
-@del $(TMPDIR)\*.res
|
||||
-@del $(TMPDIR)\*.def
|
||||
-@del $(TMPDIR)\*.exe
|
||||
-@rmdir $(OUTDIR)
|
||||
-@rmdir $(TMPDIR)
|
||||
#---------------------------------------------------------------------
|
||||
# Generate the windows help files.
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
HLPBASE = $(PROJECT)$(ITK_VERSION)
|
||||
HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp
|
||||
HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt
|
||||
DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs
|
||||
HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf
|
||||
MAN2HELP = $(DOCTMP_DIR)\man2help.tcl
|
||||
MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl
|
||||
INDEX = $(DOCTMP_DIR)\index.tcl
|
||||
BMP = $(DOCTMP_DIR)\toaster.bmp
|
||||
BMP_NOPATH = toaster.bmp
|
||||
MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe
|
||||
|
||||
winhelp: docsetup $(HELPFILE)
|
||||
|
||||
docsetup:
|
||||
@if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
|
||||
|
||||
$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F)
|
||||
copy $(TCLTOOLSDIR)\$(@F) $(@D)
|
||||
|
||||
$(BMP):
|
||||
copy $(WINDIR)\$(@F) $(@D)
|
||||
|
||||
$(HELPFILE): $(HELPRTF) $(BMP)
|
||||
cd $(DOCTMP_DIR)
|
||||
start /wait hcrtf.exe -x <<$(PROJECT).hpj
|
||||
[OPTIONS]
|
||||
COMPRESS=12 Hall Zeck
|
||||
LCID=0x409 0x0 0x0 ; English (United States)
|
||||
TITLE=[Incr Tk] Reference Manual
|
||||
BMROOT=.
|
||||
CNT=$(@B).cnt
|
||||
HLP=$(@B).hlp
|
||||
|
||||
[FILES]
|
||||
$(PROJECT).rtf
|
||||
|
||||
[WINDOWS]
|
||||
main="[Incr Tk] Reference Manual",,27648,(r15263976),(r65280)
|
||||
|
||||
[CONFIG]
|
||||
BrowseButtons()
|
||||
CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
|
||||
CreateButton(2, "SF", ExecFile("http://sf.net/projects/incrtcl"))
|
||||
CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
|
||||
CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
|
||||
<<
|
||||
cd $(MAKEDIR)
|
||||
copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
|
||||
copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
|
||||
|
||||
$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c
|
||||
$(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c -link -out:$@
|
||||
|
||||
$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX)
|
||||
$(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(ITK_VERSION) $(DOCDIR:\=/)
|
||||
|
||||
install-docs:
|
||||
!if exist($(HELPFILE))
|
||||
@xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
|
||||
@xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
|
||||
$(TCLSH) <<
|
||||
puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..."
|
||||
set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} r]
|
||||
while {![eof $$f]} {
|
||||
if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} {
|
||||
if {$$ver == $(ITK_VERSION)} {
|
||||
puts "Already installed."
|
||||
exit
|
||||
} else {
|
||||
# do something here logical to remove (or replace) it.
|
||||
puts "$$ver != $(ITK_VERSION), unfinished code path, die, die!"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
close $$f
|
||||
set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} a]
|
||||
puts $$f {:Include $(HLPBASE).cnt}
|
||||
close $$f
|
||||
<<
|
||||
start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TCL_VERSION).hlp
|
||||
!endif
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Clean up
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
tidy :
|
||||
-del $(TMP_DIR)\*.pch
|
||||
-del $(TMP_DIR)\*.obj
|
||||
-del $(TMP_DIR)\*.res
|
||||
|
||||
clean : tidy
|
||||
-del $(OUT_DIR)\*.exp
|
||||
-del $(OUT_DIR)\*.lib
|
||||
-del $(OUT_DIR)\*.dll
|
||||
|
||||
hose : clean
|
||||
-rmdir $(OUT_DIR)
|
||||
-rmdir $(TMP_DIR)
|
||||
|
||||
+356
@@ -0,0 +1,356 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* nmakehlp.c --
|
||||
*
|
||||
* This is used to fix limitations within nmake and the environment.
|
||||
*
|
||||
* Copyright (c) 2002 by David Gravereaux.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution
|
||||
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
* ----------------------------------------------------------------------------
|
||||
*/
|
||||
#include <windows.h>
|
||||
#pragma comment (lib, "user32.lib")
|
||||
#pragma comment (lib, "kernel32.lib")
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
/* protos */
|
||||
int CheckForCompilerFeature (const char *option);
|
||||
int CheckForLinkerFeature (const char *option);
|
||||
int IsIn (const char *string, const char *substring);
|
||||
int GrepForDefine (const char *file, const char *string);
|
||||
DWORD WINAPI ReadFromPipe (LPVOID args);
|
||||
|
||||
/* globals */
|
||||
#define CHUNK 25
|
||||
#define STATICBUFFERSIZE 1000
|
||||
typedef struct {
|
||||
HANDLE pipe;
|
||||
char buffer[STATICBUFFERSIZE];
|
||||
} pipeinfo;
|
||||
|
||||
pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
|
||||
pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
|
||||
|
||||
|
||||
|
||||
/* exitcodes: 0 == no, 1 == yes, 2 == error */
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char msg[300];
|
||||
DWORD dwWritten;
|
||||
int chars;
|
||||
|
||||
/* make sure children (cl.exe and link.exe) are kept quiet. */
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
|
||||
|
||||
/* Make sure the compiler and linker aren't effected by the outside world. */
|
||||
SetEnvironmentVariable("CL", "");
|
||||
SetEnvironmentVariable("LINK", "");
|
||||
|
||||
if (argc > 1 && *argv[1] == '-') {
|
||||
switch (*(argv[1]+1)) {
|
||||
case 'c':
|
||||
if (argc != 3) {
|
||||
chars = wsprintf(msg, "usage: %s -c <compiler option>\n"
|
||||
"Tests for whether cl.exe supports an option\n"
|
||||
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
|
||||
return 2;
|
||||
}
|
||||
return CheckForCompilerFeature(argv[2]);
|
||||
case 'l':
|
||||
if (argc != 3) {
|
||||
chars = wsprintf(msg, "usage: %s -l <linker option>\n"
|
||||
"Tests for whether link.exe supports an option\n"
|
||||
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
|
||||
return 2;
|
||||
}
|
||||
return CheckForLinkerFeature(argv[2]);
|
||||
case 'f':
|
||||
if (argc == 2) {
|
||||
chars = wsprintf(msg, "usage: %s -f <string> <substring>\n"
|
||||
"Find a substring within another\n"
|
||||
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
|
||||
return 2;
|
||||
} else if (argc == 3) {
|
||||
/* if the string is blank, there is no match */
|
||||
return 0;
|
||||
} else {
|
||||
return IsIn(argv[2], argv[3]);
|
||||
}
|
||||
case 'g':
|
||||
if (argc == 2) {
|
||||
chars = wsprintf(msg, "usage: %s -g <file> <string>\n"
|
||||
"grep for a #define\n"
|
||||
"exitcodes: integer of the found string (no decimals)\n", argv[0]);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
|
||||
return 2;
|
||||
}
|
||||
return GrepForDefine(argv[2], argv[3]);
|
||||
}
|
||||
}
|
||||
chars = wsprintf(msg, "usage: %s -c|-l|-f ...\n"
|
||||
"This is a little helper app to equalize shell differences between WinNT and\n"
|
||||
"Win9x and get nmake.exe to accomplish its job.\n",
|
||||
argv[0]);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
|
||||
return 2;
|
||||
}
|
||||
|
||||
int
|
||||
CheckForCompilerFeature (const char *option)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
SECURITY_ATTRIBUTES sa;
|
||||
DWORD threadID;
|
||||
char msg[300];
|
||||
BOOL ok;
|
||||
HANDLE hProcess, h, pipeThreads[2];
|
||||
char cmdline[100];
|
||||
|
||||
hProcess = GetCurrentProcess();
|
||||
|
||||
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
|
||||
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||
si.cb = sizeof(STARTUPINFO);
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
si.hStdInput = INVALID_HANDLE_VALUE;
|
||||
|
||||
ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
|
||||
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = FALSE;
|
||||
|
||||
/* create a non-inheritible pipe. */
|
||||
CreatePipe(&Out.pipe, &h, &sa, 0);
|
||||
|
||||
/* dupe the write side, make it inheritible, and close the original. */
|
||||
DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
|
||||
|
||||
/* Same as above, but for the error side. */
|
||||
CreatePipe(&Err.pipe, &h, &sa, 0);
|
||||
DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
|
||||
|
||||
/* base command line */
|
||||
strcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X ");
|
||||
/* append our option for testing */
|
||||
strcat(cmdline, option);
|
||||
/* filename to compile, which exists, but is nothing and empty. */
|
||||
strcat(cmdline, " .\\nul");
|
||||
|
||||
ok = CreateProcess(
|
||||
NULL, /* Module name. */
|
||||
cmdline, /* Command line. */
|
||||
NULL, /* Process handle not inheritable. */
|
||||
NULL, /* Thread handle not inheritable. */
|
||||
TRUE, /* yes, inherit handles. */
|
||||
DETACHED_PROCESS, /* No console for you. */
|
||||
NULL, /* Use parent's environment block. */
|
||||
NULL, /* Use parent's starting directory. */
|
||||
&si, /* Pointer to STARTUPINFO structure. */
|
||||
&pi); /* Pointer to PROCESS_INFORMATION structure. */
|
||||
|
||||
if (!ok) {
|
||||
DWORD err = GetLastError();
|
||||
int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
|
||||
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
|
||||
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
|
||||
(300-chars), 0);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* close our references to the write handles that have now been inherited. */
|
||||
CloseHandle(si.hStdOutput);
|
||||
CloseHandle(si.hStdError);
|
||||
|
||||
WaitForInputIdle(pi.hProcess, 5000);
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
/* start the pipe reader threads. */
|
||||
pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
|
||||
pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
|
||||
|
||||
/* block waiting for the process to end. */
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
/* wait for our pipe to get done reading, should it be a little slow. */
|
||||
WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
|
||||
CloseHandle(pipeThreads[0]);
|
||||
CloseHandle(pipeThreads[1]);
|
||||
|
||||
/* look for the commandline warning code in both streams. */
|
||||
return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL);
|
||||
}
|
||||
|
||||
int
|
||||
CheckForLinkerFeature (const char *option)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
SECURITY_ATTRIBUTES sa;
|
||||
DWORD threadID;
|
||||
char msg[300];
|
||||
BOOL ok;
|
||||
HANDLE hProcess, h, pipeThreads[2];
|
||||
char cmdline[100];
|
||||
|
||||
hProcess = GetCurrentProcess();
|
||||
|
||||
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
|
||||
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||
si.cb = sizeof(STARTUPINFO);
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
si.hStdInput = INVALID_HANDLE_VALUE;
|
||||
|
||||
ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
|
||||
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = TRUE;
|
||||
|
||||
/* create a non-inheritible pipe. */
|
||||
CreatePipe(&Out.pipe, &h, &sa, 0);
|
||||
|
||||
/* dupe the write side, make it inheritible, and close the original. */
|
||||
DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
|
||||
|
||||
/* Same as above, but for the error side. */
|
||||
CreatePipe(&Err.pipe, &h, &sa, 0);
|
||||
DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
|
||||
|
||||
/* base command line */
|
||||
strcpy(cmdline, "link.exe -nologo ");
|
||||
/* append our option for testing */
|
||||
strcat(cmdline, option);
|
||||
|
||||
ok = CreateProcess(
|
||||
NULL, /* Module name. */
|
||||
cmdline, /* Command line. */
|
||||
NULL, /* Process handle not inheritable. */
|
||||
NULL, /* Thread handle not inheritable. */
|
||||
TRUE, /* yes, inherit handles. */
|
||||
DETACHED_PROCESS, /* No console for you. */
|
||||
NULL, /* Use parent's environment block. */
|
||||
NULL, /* Use parent's starting directory. */
|
||||
&si, /* Pointer to STARTUPINFO structure. */
|
||||
&pi); /* Pointer to PROCESS_INFORMATION structure. */
|
||||
|
||||
if (!ok) {
|
||||
DWORD err = GetLastError();
|
||||
int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
|
||||
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
|
||||
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
|
||||
(300-chars), 0);
|
||||
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* close our references to the write handles that have now been inherited. */
|
||||
CloseHandle(si.hStdOutput);
|
||||
CloseHandle(si.hStdError);
|
||||
|
||||
WaitForInputIdle(pi.hProcess, 5000);
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
/* start the pipe reader threads. */
|
||||
pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
|
||||
pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
|
||||
|
||||
/* block waiting for the process to end. */
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
/* wait for our pipe to get done reading, should it be a little slow. */
|
||||
WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
|
||||
CloseHandle(pipeThreads[0]);
|
||||
CloseHandle(pipeThreads[1]);
|
||||
|
||||
/* look for the commandline warning code in the stderr stream. */
|
||||
return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL);
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
ReadFromPipe (LPVOID args)
|
||||
{
|
||||
pipeinfo *pi = (pipeinfo *) args;
|
||||
char *lastBuf = pi->buffer;
|
||||
DWORD dwRead;
|
||||
BOOL ok;
|
||||
|
||||
again:
|
||||
if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) {
|
||||
CloseHandle(pi->pipe);
|
||||
return -1;
|
||||
}
|
||||
ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L);
|
||||
if (!ok || dwRead == 0) {
|
||||
CloseHandle(pi->pipe);
|
||||
return 0;
|
||||
}
|
||||
lastBuf += dwRead;
|
||||
goto again;
|
||||
|
||||
return 0; /* makes the compiler happy */
|
||||
}
|
||||
|
||||
int
|
||||
IsIn (const char *string, const char *substring)
|
||||
{
|
||||
return (strstr(string, substring) != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find a specified #define by name.
|
||||
*
|
||||
* If the line is '#define TCL_VERSION "8.5"', it returns
|
||||
* 85 as the result.
|
||||
*/
|
||||
|
||||
int
|
||||
GrepForDefine (const char *file, const char *string)
|
||||
{
|
||||
FILE *f;
|
||||
char s1[51], s2[51], s3[51];
|
||||
int r = 0;
|
||||
double d1;
|
||||
|
||||
f = fopen(file, "rt");
|
||||
if (f == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
do {
|
||||
r = fscanf(f, "%50s", s1);
|
||||
if (r == 1 && !strcmp(s1, "#define")) {
|
||||
/* get next two words */
|
||||
r = fscanf(f, "%50s %50s", s2, s3);
|
||||
if (r != 2) continue;
|
||||
/* is the first word what we're looking for? */
|
||||
if (!strcmp(s2, string)) {
|
||||
fclose(f);
|
||||
/* add 1 past first double quote char. "8.5" */
|
||||
d1 = atof(s3 + 1); /* 8.5 */
|
||||
while (floor(d1) != d1) {
|
||||
d1 *= 10.0;
|
||||
}
|
||||
return ((int) d1); /* 85 */
|
||||
}
|
||||
}
|
||||
} while (!feof(f));
|
||||
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# Tcl package index file, version 1.0
|
||||
|
||||
package ifneeded Itk 3.0 [list load [file join $dir itk30.dll] Itk]
|
||||
@@ -1,2 +0,0 @@
|
||||
0( @���B���R�*��
|
||||
��~�~
|
||||
@@ -1,2 +0,0 @@
|
||||
0( @ÿÿÿ€À
|
||||
�"ˆB„þþþþB„"ˆ�
|
||||
@@ -1,2 +0,0 @@
|
||||
0( @€ÿÿÿ€Àà
|
||||
°˜€€€€˜
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
0( @€ÿÿÿ``ÀÀ
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user