Itk - the [incr Tk] extension

Changes On Branch itk-3-branch
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch itk-3-branch Excluding Merge-Ins

This is equivalent to a diff from 2ab14ee8b8 to ac6afc928a

2018-06-14
12:43
Remove Mac OS 9 support. Leaf check-in: ac6afc928a user: dgp tags: itk-3-branch
2016-03-01
15:42
merge release check-in: 1b04f825dc user: dgp tags: itk-3-branch
2011-04-20
14:56
Purge RCS keywords and .cvsignore files check-in: 72c13a0b6e user: dgp tags: itk-3-branch
2010-08-17
21:20
* itcl/Makefile.in, itk/Makefile.in (TCL_TOP_DIR_NATIVE): no longer necessary for private header builds
Closed-Leaf check-in: 2ab14ee8b8 user: hobbs tags: trunk
01:20
* itcl/Makefile.in, itcl/configure, itcl/configure.in: * itk/Makefile.in, itk/configure, itk/configure.in: * configure, configure.in: update to TEA 3.9, regen with ac-2.59
check-in: 4fbcd57e3a user: hobbs tags: trunk

Deleted .cvsignore.

1
2
3
Makefile
config.log
confdefs.h
<
<
<






Changes to Makefile.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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.
#
# RCS: @(#) $Id: Makefile.in,v 1.33 2010/08/17 21:20:26 hobbs Exp $

#========================================================================
# 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.













<
<







1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20
# 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.
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	    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" $(TESTFLAGS) | cat

shell: binaries libraries
	@$(WISH) $(SCRIPT)

gdb:
	$(TCLSH_ENV) gdb $(WISH_PROG) $(SCRIPT)








|







223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
	    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)

Changes to configure.

more than 10,000 changes

Changes to doc/Archetype.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: Archetype.n,v 1.2 2004/09/01 04:23:10 davygrvy Exp $
'\"
.so man.macros
.TH Archetype n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Archetype \- base class for all [incr\ Tk] mega-widgets
.SH "INHERITANCE"






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH Archetype n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Archetype \- base class for all [incr\ Tk] mega-widgets
.SH "INHERITANCE"

Changes to doc/Toplevel.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: Toplevel.n,v 1.4 2004/09/01 04:23:10 davygrvy Exp $
'\"
.so man.macros
.TH Toplevel n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Toplevel \- base class for mega-widgets in a top-level window
.SH "INHERITANCE"






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH Toplevel n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Toplevel \- base class for mega-widgets in a top-level window
.SH "INHERITANCE"

Changes to doc/Widget.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: Widget.n,v 1.2 2004/09/01 04:23:10 davygrvy Exp $
'\"
.so man.macros
.TH Widget n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Widget \- base class for mega-widgets within a frame
.SH "INHERITANCE"






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH Widget n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
Widget \- base class for mega-widgets within a frame
.SH "INHERITANCE"

Changes to doc/itk.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: 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
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
itk \- framework for building mega-widgets in Tcl/Tk
.BE






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH itk n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
itk \- framework for building mega-widgets in Tcl/Tk
.BE

Changes to doc/itkvars.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: 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
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
itkvars \- variables used by [incr\ Tk]
.BE






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH itkvars n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
itkvars \- variables used by [incr\ Tk]
.BE

Changes to doc/usual.n.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'\"
'\" 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: usual.n,v 1.2 2004/09/01 04:23:10 davygrvy Exp $
'\"
.so man.macros
.TH usual n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
usual \- access default option-handling commands
.br






<
<







1
2
3
4
5
6


7
8
9
10
11
12
13
'\"
'\" 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.
'\"


.so man.macros
.TH usual n 3.0 itk "[incr\ Tk]"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
usual \- access default option-handling commands
.br

Changes to generic/itk.decls.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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.
# 
# RCS: $Id: itk.decls,v 1.5 2002/03/03 01:57:11 andreas_kupries Exp $

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.








<
<







1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
# 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.

Changes to generic/itk.h.

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 *           above is included in this distribution.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itk.h,v 1.18 2007/05/24 22:15:41 hobbs 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.
 */
#ifndef ITK_H







<
<







33
34
35
36
37
38
39


40
41
42
43
44
45
46
 *           above is included in this distribution.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl


 * ========================================================================
 *           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.
 */
#ifndef ITK_H
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#   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	0

#define ITK_VERSION		"3.4"
#define ITK_PATCH_LEVEL		"3.4.0"


/*
 * A special definition used to allow this header file to be included
 * in resource files so that they can get obtain version information from
 * this file.  Resource compilers don't like all the C stuff, like typedefs
 * and procedure declarations, that occur below.







|


|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#   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
 * this file.  Resource compilers don't like all the C stuff, like typedefs
 * and procedure declarations, that occur below.

Changes to generic/itkDecls.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * 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.
 *
 * RCS: $Id: itkDecls.h,v 1.8 2003/12/23 05:22:45 davygrvy Exp $
 */

#ifndef _ITKDECLS
#define _ITKDECLS

#ifdef BUILD_itk
#undef TCL_STORAGE_CLASS







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
/*
 * 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

Changes to generic/itkStubInit.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 
 * 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.
 *
 * RCS: $Id: itkStubInit.c,v 1.3 2001/06/22 04:38:54 davygrvy Exp $
 */

#include "itk.h"

/*
 * Remove macros that will interfere with the definitions below.
 */









<
<







1
2
3
4
5
6
7
8
9


10
11
12
13
14
15
16
/* 
 * 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.
 */

Changes to generic/itkStubLib.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* 
 * 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.
 *
 * RCS: $Id: itkStubLib.c,v 1.7 2003/12/24 03:38:03 davygrvy Exp $
 */

/*
 * 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.











<
<







1
2
3
4
5
6
7
8
9
10
11


12
13
14
15
16
17
18
/* 
 * 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.

Changes to generic/itk_archetype.c.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 *    Itk_ArchDeleteOptsCmd  <=> _deleteOptionInfo (used to clean things up)
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itk_archetype.c,v 1.12 2007/05/24 22:12:55 hobbs 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.
 */
#include <assert.h>







<
<







21
22
23
24
25
26
27


28
29
30
31
32
33
34
 *    Itk_ArchDeleteOptsCmd  <=> _deleteOptionInfo (used to clean things up)
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl


 * ========================================================================
 *           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.
 */
#include <assert.h>
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
        parserNs, /* isProcCallFrame */ 0);

    if (result == TCL_OK) {
        result = Tcl_EvalObj(interp, objPtr);
        Tcl_PopCallFrame(interp);
    }

    if (objPtr != objv[3]) {
        Tcl_DecrRefCount(objPtr);
    }
    if (result != TCL_OK) {
        goto compFail;
    }

    Itk_DelGenericOptTable(mergeInfo->optionTable);







|







983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
        parserNs, /* isProcCallFrame */ 0);

    if (result == TCL_OK) {
        result = Tcl_EvalObj(interp, objPtr);
        Tcl_PopCallFrame(interp);
    }

    if (objc != 4) {
        Tcl_DecrRefCount(objPtr);
    }
    if (result != TCL_OK) {
        goto compFail;
    }

    Itk_DelGenericOptTable(mergeInfo->optionTable);
1744
1745
1746
1747
1748
1749
1750

1751


1752
1753
1754
1755










1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784

    /*
     *  Integrate all public variables for the current class
     *  context into the composite option list.
     */
    Itcl_InitHierIter(&hier, contextClass);
    while ((cdefn=Itcl_AdvanceHierIter(&hier)) != NULL) {

        entry = Tcl_FirstHashEntry(&cdefn->variables, &place);


        while (entry) {
            vdefn = (ItclVarDefn*)Tcl_GetHashValue(entry);

            if (vdefn->member->protection == ITCL_PUBLIC) {










                optPart = Itk_FindArchOptionPart(info,
                    vdefn->member->name, (ClientData)vdefn);

                if (!optPart) {
                    optPart = Itk_CreateOptionPart(interp, (ClientData)vdefn,
                        Itk_PropagatePublicVar, (Tcl_CmdDeleteProc*)NULL,
                        (ClientData)vdefn);

                    val = Itcl_GetInstanceVar(interp, vdefn->member->fullname,
                        contextObj, contextObj->classDefn);

                    result = Itk_AddOptionPart(interp, info,
                        vdefn->member->name, (char*)NULL, (char*)NULL,
                        val, (char*)NULL, optPart, &archOpt);

                    if (result != TCL_OK) {
                        Itk_DelOptionPart(optPart);
                        return TCL_ERROR;
                    }
                }
            }
            entry = Tcl_NextHashEntry(&place);
        }
    }
    Itcl_DeleteHierIter(&hier);

    /*
     *  Integrate all class-based options for the current class
     *  context into the composite option list.







>
|
>
>
|


|
>
>
>
>
>
>
>
>
>
>




















<
<







1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786


1787
1788
1789
1790
1791
1792
1793

    /*
     *  Integrate all public variables for the current class
     *  context into the composite option list.
     */
    Itcl_InitHierIter(&hier, contextClass);
    while ((cdefn=Itcl_AdvanceHierIter(&hier)) != NULL) {

	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) {
		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);

                if (!optPart) {
                    optPart = Itk_CreateOptionPart(interp, (ClientData)vdefn,
                        Itk_PropagatePublicVar, (Tcl_CmdDeleteProc*)NULL,
                        (ClientData)vdefn);

                    val = Itcl_GetInstanceVar(interp, vdefn->member->fullname,
                        contextObj, contextObj->classDefn);

                    result = Itk_AddOptionPart(interp, info,
                        vdefn->member->name, (char*)NULL, (char*)NULL,
                        val, (char*)NULL, optPart, &archOpt);

                    if (result != TCL_OK) {
                        Itk_DelOptionPart(optPart);
                        return TCL_ERROR;
                    }
                }


        }
    }
    Itcl_DeleteHierIter(&hier);

    /*
     *  Integrate all class-based options for the current class
     *  context into the composite option list.

Changes to generic/itk_cmds.c.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *  mega-widgets.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itk_cmds.c,v 1.17 2007/05/24 22:12:56 hobbs 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.
 */
#include "itk.h"







<
<







11
12
13
14
15
16
17


18
19
20
21
22
23
24
 *  mega-widgets.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl


 * ========================================================================
 *           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.
 */
#include "itk.h"
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
        global env tcl_library\n\
        variable library\n\
        variable version\n\
        rename _find_init {}\n\
        if {[info exists library]} {\n\
            lappend dirs $library\n\
        } else {\n\
            if {[catch {uplevel #0 source -rsrc itk}] == 0} {\n\
                return\n\
            }\n\
            set dirs {}\n\
            if {[info exists env(ITK_LIBRARY)]} {\n\
                lappend dirs $env(ITK_LIBRARY)\n\
            }\n\
            lappend dirs [file join [file dirname $tcl_library] itk$version]\n\
            set bindir [file dirname [info nameofexecutable]]\n\
            lappend dirs [file join $bindir .. lib itk$version]\n\







<
<
<







54
55
56
57
58
59
60



61
62
63
64
65
66
67
        global env tcl_library\n\
        variable library\n\
        variable version\n\
        rename _find_init {}\n\
        if {[info exists library]} {\n\
            lappend dirs $library\n\
        } else {\n\



            set dirs {}\n\
            if {[info exists env(ITK_LIBRARY)]} {\n\
                lappend dirs $env(ITK_LIBRARY)\n\
            }\n\
            lappend dirs [file join [file dirname $tcl_library] itk$version]\n\
            set bindir [file dirname [info nameofexecutable]]\n\
            lappend dirs [file join $bindir .. lib itk$version]\n\

Changes to generic/itk_option.c.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *  specified within class definitions.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl
 *
 *     RCS:  $Id: itk_option.c,v 1.7 2007/05/24 23:23:59 hobbs 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.
 */
#include "itk.h"







<
<







11
12
13
14
15
16
17


18
19
20
21
22
23
24
 *  specified within class definitions.
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl


 * ========================================================================
 *           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.
 */
#include "itk.h"

Changes to generic/itk_util.c.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 *  [incr Tk].
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           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.
 * ------------------------------------------------------------------------
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */
#include "itk.h"







<
<







11
12
13
14
15
16
17


18
19
20
21
22
23
24
 *  [incr Tk].
 *
 * ========================================================================
 *  AUTHOR:  Michael J. McLennan
 *           Bell Labs Innovations for Lucent Technologies
 *           [email protected]
 *           http://www.tcltk.com/itcl


 * ========================================================================
 *           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.
 */
#include "itk.h"
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
    }

    /*
     *  Perform a binary search to find the option switch quickly.
     */
    first = 0;
    last  = olist->len-1;
    swname = Tcl_GetHashKey(olist->options, entry) + 1;

    while (last >= first) {
        pos = (first+last)/2;
        optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;

        if (*swname == *optname) {
            cmp = strcmp(swname, optname);
            if (cmp == 0) {
                break;    /* found it! */
            }
        }
        else if (*swname < *optname) {







|



|
>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
    }

    /*
     *  Perform a binary search to find the option switch quickly.
     */
    first = 0;
    last  = olist->len-1;
    swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;

    while (last >= first) {
        pos = (first+last)/2;
        optname = ((char *)Tcl_GetHashKey(olist->options,
		olist->list[pos])) + 1;
        if (*swname == *optname) {
            cmp = strcmp(swname, optname);
            if (cmp == 0) {
                break;    /* found it! */
            }
        }
        else if (*swname < *optname) {
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
{
    int pos = 0;
    int i, first, last, cmp;
    char *swname, *optname;

    first = 0;
    last  = olist->len-1;
    swname = Tcl_GetHashKey(olist->options, entry) + 1;

    while (last >= first) {
        pos = (first+last)/2;
        optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;

        if (*swname == *optname) {
            cmp = strcmp(swname, optname);
            if (cmp == 0) {
                break;    /* found it! */
            }
        }
        else if (*swname < *optname) {







|



|
>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
    int pos = 0;
    int i, first, last, cmp;
    char *swname, *optname;

    first = 0;
    last  = olist->len-1;
    swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;

    while (last >= first) {
        pos = (first+last)/2;
        optname = ((char *)Tcl_GetHashKey(olist->options,
		olist->list[pos])) + 1;
        if (*swname == *optname) {
            cmp = strcmp(swname, optname);
            if (cmp == 0) {
                break;    /* found it! */
            }
        }
        else if (*swname < *optname) {

Changes to library/Archetype.itk.

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#     none
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            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.
# ======================================================================
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.

itcl::class itk::Archetype {







<
<







41
42
43
44
45
46
47


48
49
50
51
52
53
54
#     none
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

itcl::class itk::Archetype {

Changes to library/Toplevel.itk.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#      class:  Title
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: Toplevel.itk,v 1.4 2007/05/24 23:29:30 hobbs 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.

itcl::class itk::Toplevel {







<
<







19
20
21
22
23
24
25


26
27
28
29
30
31
32
#      class:  Title
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

itcl::class itk::Toplevel {

Changes to library/Widget.itk.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#      class:  Cursur
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: Widget.itk,v 1.3 2007/05/24 23:27:05 hobbs 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.

itcl::class itk::Widget {







<
<







17
18
19
20
21
22
23


24
25
26
27
28
29
30
#      class:  Cursur
#
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

itcl::class itk::Widget {

Changes to library/itk.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# itk.tcl
# ----------------------------------------------------------------------
# Invoked automatically upon startup to customize the interpreter
# for [incr Tk].
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: itk.tcl,v 1.3 2002/05/14 22:53:28 davygrvy 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.

#
# Provide transparent access to all [incr Tk] commands
#
if {$tcl_platform(os) == "MacOS"} {
    source -rsrc itk:tclIndex
} else {
    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










<
<









<
<
<
|
<







1
2
3
4
5
6
7
8
9
10


11
12
13
14
15
16
17
18
19



20

21
22
23
24
25
26
27
#
# itk.tcl
# ----------------------------------------------------------------------
# Invoked automatically upon startup to customize the interpreter
# for [incr Tk].
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

#
# Provide transparent access to all [incr Tk] commands
#



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

Changes to tests/all.

1
2
3
4
5
6
7
8
9
10
11
12
# 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]] {



<
<







1
2
3


4
5
6
7
8
9
10
# 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.


# ------------------------------------------------------------------
# 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]] {

Changes to tests/all.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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.
# 
# RCS: @(#) $Id: all.tcl,v 1.4 2004/09/22 09:37:08 davygrvy Exp $

package require tcltest 2.1

tcltest::testsDirectory [file dir [info script]]
tcltest::runAllTests

return








<
<







1
2
3
4
5
6
7
8


9
10
11
12
13
14
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

Changes to tests/defs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This file contains support code for the Tcl test suite.  It is
# normally sourced by the individual files in the test suite before
# they run their tests.  This improved approach to testing was designed
# and initially implemented by Mary Ann May-Pumphrey of Sun Microsystems.
#
# Copyright (c) 1990-1994 The Regents of the University of California.
# Copyright (c) 1994-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: @(#) 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] {










<
<







1
2
3
4
5
6
7
8
9
10


11
12
13
14
15
16
17
# This file contains support code for the Tcl test suite.  It is
# normally sourced by the individual files in the test suite before
# they run their tests.  This improved approach to testing was designed
# and initially implemented by Mary Ann May-Pumphrey of Sun Microsystems.
#
# Copyright (c) 1990-1994 The Regents of the University of California.
# Copyright (c) 1994-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.


# ------------------------------------------------------------------
# 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] {

Changes to tests/interp.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Tests for using [incr Tcl] in slave interpreters
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: interp.test,v 1.4 2007/11/05 22:41:33 davygrvy 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Tests for using [incr Tcl] in slave interpreters
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Changes to tests/option.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Basic tests for [incr Tk] mega-widgets
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: option.test,v 1.4 2004/09/22 09:37:09 davygrvy 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Basic tests for [incr Tk] mega-widgets
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Changes to tests/privacy.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Privacy options for components
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: privacy.test,v 1.3 2004/09/22 09:37:09 davygrvy 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Privacy options for components
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Changes to tests/public.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Public variables as configuration options
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: public.test,v 1.3 2004/09/22 09:37:09 davygrvy 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Public variables as configuration options
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Changes to tests/toplevel.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Tests for [incr Tk] widgets based on itk::Toplevel
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: toplevel.test,v 1.5 2007/05/24 23:29:30 hobbs 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Tests for [incr Tk] widgets based on itk::Toplevel
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Changes to tests/widget.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Tests for [incr Tk] widgets based on itk::Widget
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl
#
#      RCS:  $Id: widget.test,v 1.6 2004/09/22 09:37:09 davygrvy 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.

package require tcltest







<
<







1
2
3
4
5
6
7


8
9
10
11
12
13
14
#
# Tests for [incr Tk] widgets based on itk::Widget
# ----------------------------------------------------------------------
#   AUTHOR:  Michael J. McLennan
#            Bell Labs Innovations for Lucent Technologies
#            [email protected]
#            http://www.tcltk.com/itcl


# ----------------------------------------------------------------------
#            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.

package require tcltest

Deleted win/.cvsignore.

1
2
3
4
Debug
Release
nmakehlp.obj
nmakehlp.exe
<
<
<
<








Changes to win/makefile.vc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#------------------------------------------------------------------------------
# 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) 1993-1998 Lucent Technologies, Inc.
# RCS: $Id: makefile.vc,v 1.31 2007/11/05 22:35:17 davygrvy Exp $
#------------------------------------------------------------------------------
#  Do not modify this file!
#------------------------------------------------------------------------------

!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

PROJECT	= itk
!include "..\..\rules.vc"


!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







<












|







1
2
3
4
5
6
7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#------------------------------------------------------------------------------
# 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) 1993-1998 Lucent Technologies, Inc.

#------------------------------------------------------------------------------
#  Do not modify this file!
#------------------------------------------------------------------------------

!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

PROJECT	= itk
!include "rules.vc"


!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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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\Release\$(ITCLIMPLIBNAME)"


!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\Release\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\Release\$(ITCLSTUBLIBNAME)"

### For Tcl 8.0
!if !$(TCL_DOES_STUBS)
TCLSTUBLIB	= $(TCLIMPLIB)
TKSTUBLIB	= $(TKIMPLIB)
ITCLSTUBLIB	= $(ITCLIMPLIB)
!endif







|










|










|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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)"


!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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
!endif
!else
# This cranks the optimization level up to max.
cdebug = -O2
!endif

# declarations common to all compiler options
cflags = -nologo -c -W3 -YX -Fp$(TMP_DIR)^\

!if $(PENT_0F_ERRATA)
cflags = $(cflags) -QI0f
!endif

!if $(ITAN_B_ERRATA)
cflags = $(cflags) -QIA64_Bx







|







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
!endif
!else
# This cranks the optimization level up to max.
cdebug = -O2
!endif

# declarations common to all compiler options
cflags = -nologo -c -W3 -YX -D_USE_32BIT_TIME_T -Fp$(TMP_DIR)^\

!if $(PENT_0F_ERRATA)
cflags = $(cflags) -QI0f
!endif

!if $(ITAN_B_ERRATA)
cflags = $(cflags) -QIA64_Bx

Changes to win/nmakehlp.c.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* ----------------------------------------------------------------------------
 * 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.
 *
 * ----------------------------------------------------------------------------
 * RCS: @(#) $Id: nmakehlp.c,v 1.4 2004/04/29 17:40:44 davygrvy Exp $
 * ----------------------------------------------------------------------------
 */
#include <windows.h>
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "kernel32.lib")
#include <stdio.h>
#include <math.h>









<
<
<







1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
/* ----------------------------------------------------------------------------
 * 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>

Changes to win/rc/itk.rc.

1
2
3
4
5
6
7
8
// RCS: @(#) $Id: itk.rc,v 1.10 2003/12/23 10:01:35 davygrvy Exp $
//
// Version resource script.
//

#include <winver.h>
#include <itcl.h>
#include <itk.h>
<








1
2
3
4
5
6
7

//
// Version resource script.
//

#include <winver.h>
#include <itcl.h>
#include <itk.h>

Added win/rules.vc.





















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
#------------------------------------------------------------------------------
# rules.vc --
#
#	Microsoft Visual C++ makefile include for decoding the commandline
#	macros.  This file does not need editing to build Tcl.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# Copyright (c) 2001-2003 David Gravereaux.
#
#------------------------------------------------------------------------------
# RCS: @(#) $Id: rules.vc,v 1.5 2004/04/29 17:40:43 davygrvy Exp $
#------------------------------------------------------------------------------

!ifndef _RULES_VC
_RULES_VC = 1

cc32		= $(CC)   # built-in default.
link32		= link
lib32		= lib
rc32		= $(RC)   # built-in default.

!ifndef INSTALLDIR
### Assume the normal default.
_INSTALLDIR	= C:\Program Files\Tcl
!else
### Fix the path seperators.
_INSTALLDIR	= $(INSTALLDIR:/=\)
!endif

#------------------------------------------------------------------------------
# Determine the host and target architectures and compiler version.
#------------------------------------------------------------------------------

_HASH=^#
_VC_MANIFEST_EMBED_EXE=
_VC_MANIFEST_EMBED_DLL=
VCVER=0
!if ![echo VCVERSION=_MSC_VER > vercl.x] \
    && ![echo $(_HASH)if defined(_M_IX86) >> vercl.x] \
    && ![echo ARCH=IX86 >> vercl.x] \
    && ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
    && ![echo ARCH=AMD64 >> vercl.x] \
    && ![echo $(_HASH)endif >> vercl.x] \
    && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
!include vercl.i
!if ![echo VCVER= ^\> vercl.vc] \
    && ![set /a $(VCVERSION) / 100 - 6 >> vercl.vc]
!include vercl.vc
!endif
!endif
!if ![del $(ERRNUL) /q/f vercl.x vercl.i vercl.vc]
!endif

!if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]
NATIVE_ARCH=IX86
!else
NATIVE_ARCH=AMD64
!endif

# Since MSVC8 we must deal with manifest resources.
!if $(VCVERSION) >= 1400
_VC_MANIFEST_EMBED_EXE=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:$@;1
_VC_MANIFEST_EMBED_DLL=if exist [email protected] mt -nologo -manifest [email protected] -outputresource:$@;2
!endif

!ifndef MACHINE
MACHINE		= IX86
!endif

!ifndef CFG_ENCODING
CFG_ENCODING	= \"cp1252\"
!endif

#----------------------------------------------------------
# Set the proper copy method to avoid overwrite questions
# to the user when copying files and selecting the right
# "delete all" method.
#----------------------------------------------------------

!if "$(OS)" == "Windows_NT"
RMDIR	= rmdir /S /Q
!if ![ver | find "4.0" > nul]
CPY	= echo y | xcopy /i
!else
CPY	= xcopy /i /y
!endif
!else
CPY	= xcopy /i
RMDIR	= deltree /Y
!endif


!message ===============================================================================

#----------------------------------------------------------
# build the helper app we need to overcome nmake's limiting
# environment.
#----------------------------------------------------------

!if !exist(nmakehlp.exe)
!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
!endif
!endif

#----------------------------------------------------------
# Test for compiler features
#----------------------------------------------------------

### test for optimizations
!if [nmakehlp -c -Otip]
!message *** Compiler has 'Optimizations'
OPTIMIZING	= 1
!else
!message *** Compiler doesn't have 'Optimizations'
OPTIMIZING	= 0
!endif

!if "$(MACHINE)" == "IX86"
### test for pentium errata
!if [nmakehlp -c -QI0f]
!message *** Compiler has 'Pentium 0x0f fix'
PENT_0F_ERRATA	= 1
!else
!message *** Compiler doesn't have 'Pentium 0x0f fix'
PENT_0F_ERRATA	= 0
!endif
### test for -align:4096, when align:512 will do.
!if [nmakehlp -l -opt:nowin98]
!message *** Linker has 'Win98 alignment problem'
ALIGN98_HACK	= 1
!else
!message *** Linker doesn't have 'Win98 alignment problem'
ALIGN98_HACK	= 0
!endif
!else
PENT_0F_ERRATA	= 0
ALIGN98_HACK	= 0
!endif

!if "$(MACHINE)" == "IA64"
### test for Itanium errata
!if [nmakehlp -c -QIA64_Bx]
!message *** Compiler has 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 1
!else
!message *** Compiler doesn't have 'B-stepping errata workarounds'
ITAN_B_ERRATA	= 0
!endif
!else
ITAN_B_ERRATA	= 0
!endif

#----------------------------------------------------------
# Decode the options requested.
#----------------------------------------------------------

!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
STATIC_BUILD	= 0
TCL_THREADS	= 0
DEBUG		= 0
PROFILE		= 0
MSVCRT		= 0
LOIMPACT	= 0
TCL_USE_STATIC_PACKAGES	= 0
USE_THREAD_ALLOC = 0
UNCHECKED	= 0
!else
!if [nmakehlp -f $(OPTS) "static"]
!message *** Doing static
STATIC_BUILD	= 1
!else
STATIC_BUILD	= 0
!endif
!if [nmakehlp -f $(OPTS) "msvcrt"]
!message *** Doing msvcrt
MSVCRT		= 1
!else
MSVCRT		= 0
!endif
!if [nmakehlp -f $(OPTS) "staticpkg"]
!message *** Doing staticpkg
TCL_USE_STATIC_PACKAGES	= 1
!else
TCL_USE_STATIC_PACKAGES	= 0
!endif
!if [nmakehlp -f $(OPTS) "threads"]
!message *** Doing threads
TCL_THREADS	= 1
!else
TCL_THREADS	= 0
!endif
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG		= 1
!else
DEBUG		= 0
!endif
!if [nmakehlp -f $(OPTS) "profile"]
!message *** Doing profile
PROFILE		= 1
!else
PROFILE		= 0
!endif
!if [nmakehlp -f $(OPTS) "loimpact"]
!message *** Doing loimpact
LOIMPACT	= 1
!else
LOIMPACT	= 0
!endif
!if [nmakehlp -f $(OPTS) "thrdalloc"]
!message *** Doing thrdalloc
USE_THREAD_ALLOC = 1
!else
USE_THREAD_ALLOC = 0
!endif
!if [nmakehlp -f $(OPTS) "unchecked"]
!message *** Doing unchecked
UNCHECKED = 1
!else
UNCHECKED = 0
!endif
!endif


!if !$(STATIC_BUILD)
# Make sure we don't build overly fat DLLs.
MSVCRT		= 1
# We shouldn't statically put the extensions inside the shell when dynamic.
TCL_USE_STATIC_PACKAGES = 0
!endif


#----------------------------------------------------------
# Figure-out how to name our intermediate and output directories.
# We wouldn't want different builds to use the same .obj files
# by accident.
#----------------------------------------------------------

#----------------------------------------
# Naming convention:
#   t = full thread support.
#   s = static library (as opposed to an
#	import library)
#   g = linked to the debug enabled C
#	run-time.
#   x = special static build when it
#	links to the dynamic C run-time.
#----------------------------------------
SUFX	    = tsgx

!if $(DEBUG)
BUILDDIRTOP = Debug
!else
BUILDDIRTOP = Release
!endif

!if "$(MACHINE)" != "IX86"
BUILDDIRTOP =$(BUILDDIRTOP)_$(MACHINE)
!endif
!if $(VCVER) > 6
BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER)
!endif

!if !$(DEBUG) || $(DEBUG) && $(UNCHECKED)
SUFX	    = $(SUFX:g=)
!endif

TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX

!if !$(STATIC_BUILD)
TMP_DIRFULL = $(TMP_DIRFULL:Static=)
SUFX	    = $(SUFX:s=)
EXT	    = dll
!if $(MSVCRT)
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX	    = $(SUFX:x=)
!endif
!else
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
EXT	    = lib
!if !$(MSVCRT)
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX	    = $(SUFX:x=)
!endif
!endif

!if !$(TCL_THREADS)
TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
SUFX	    = $(SUFX:t=)
!endif

!ifndef TMP_DIR
TMP_DIR	    = $(TMP_DIRFULL)
!ifndef OUT_DIR
OUT_DIR	    = .\$(BUILDDIRTOP)
!endif
!else
!ifndef OUT_DIR
OUT_DIR	    = $(TMP_DIR)
!endif
!endif


#----------------------------------------------------------
# Decode the statistics requested.
#----------------------------------------------------------

!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
TCL_MEM_DEBUG	    = 0
TCL_COMPILE_DEBUG   = 0
!else
!if [nmakehlp -f $(STATS) "memdbg"]
!message *** Doing memdbg
TCL_MEM_DEBUG	    = 1
!else
TCL_MEM_DEBUG	    = 0
!endif
!if [nmakehlp -f $(STATS) "compdbg"]
!message *** Doing compdbg
TCL_COMPILE_DEBUG   = 1
!else
TCL_COMPILE_DEBUG   = 0
!endif
!endif


#----------------------------------------------------------
# Decode the checks requested.
#----------------------------------------------------------

!if "$(CHECKS)" == "" || [nmakehlp -f "$(CHECKS)" "none"]
TCL_NO_DEPRECATED	    = 0
FULLWARNINGS		    = 0
!else
!if [nmakehlp -f $(CHECKS) "nodep"]
!message *** Doing nodep check
TCL_NO_DEPRECATED	    = 1
!else
TCL_NO_DEPRECATED	    = 0
!endif
!if [nmakehlp -f $(CHECKS) "fullwarn"]
!message *** Doing full warnings check
FULLWARNINGS		    = 1
!else
FULLWARNINGS		    = 0
!endif
!endif


#----------------------------------------------------------
# Set our defines now armed with our options.
#----------------------------------------------------------

OPTDEFINES	= -DTCL_CFGVAL_ENCODING=$(CFG_ENCODING)

!if $(TCL_MEM_DEBUG)
OPTDEFINES	= $(OPTDEFINES) -DTCL_MEM_DEBUG
!endif
!if $(TCL_COMPILE_DEBUG)
OPTDEFINES	= $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
!endif
!if $(TCL_THREADS)
OPTDEFINES	= $(OPTDEFINES) -DTCL_THREADS=1
!if $(USE_THREAD_ALLOC)
OPTDEFINES	= $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
!endif
!endif
!if $(STATIC_BUILD)
OPTDEFINES	= $(OPTDEFINES) -DSTATIC_BUILD
!endif
!if $(TCL_NO_DEPRECATED)
OPTDEFINES	= $(OPTDEFINES) -DTCL_NO_DEPRECATED
!endif

!if $(DEBUG)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DEBUG
!elseif $(OPTIMIZING)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
!endif
!if $(PROFILE)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED
!endif
!if "$(MACHINE)" == "IA64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif


#----------------------------------------------------------
# Get common info used when building extensions.
#----------------------------------------------------------

!if "$(PROJECT)" != "tcl"

!if !defined(TCLDIR)
!if exist("$(_INSTALLDIR)\include\tcl.h")
TCLH		= "$(_INSTALLDIR)\include\tcl.h"
TCLINSTALL	= 1
_TCLDIR		= $(_INSTALLDIR)
!else
MSG=^
Don't know where tcl.h is.  Set the TCLDIR macro.
!error $(MSG)
!endif
!else
_TCLDIR	= $(TCLDIR:/=\)
!if exist("$(_TCLDIR)\include\tcl.h")
TCLH		= "$(_TCLDIR)\include\tcl.h"
TCLINSTALL	= 1
!elseif exist("$(_TCLDIR)\generic\tcl.h")
TCLH		= "$(_TCLDIR)\generic\tcl.h"
TCLINSTALL	= 0
!else
MSG =^
Don't know where tcl.h is.  The TCLDIR macro doesn't appear correct.
!error $(MSG)
!endif
!endif

#----------------------------------------------------------
# Get the version from the header file.  Try all possibles
# even though some aren't fully valid.
#----------------------------------------------------------

!if [nmakehlp -g $(TCLH) TCL_VERSION] == 76
TCL_DOTVERSION	= 7.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 80
TCL_DOTVERSION	= 8.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 81
TCL_DOTVERSION	= 8.1
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 82
TCL_DOTVERSION	= 8.2
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 83
TCL_DOTVERSION	= 8.3
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 84
TCL_DOTVERSION	= 8.4
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 85
TCL_DOTVERSION	= 8.5
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 86
TCL_DOTVERSION	= 8.6
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 90
TCL_DOTVERSION	= 9.0
!elseif [nmakehlp -g $(TCLH) TCL_VERSION] == 0
MSG =^
Can't get version string from $(TCLH)
!error $(MSG)
!endif

TCL_VERSION	= $(TCL_DOTVERSION:.=)

!if $(TCL_VERSION) < 81
TCL_DOES_STUBS	= 0
!else
TCL_DOES_STUBS	= 1
!endif

!if $(TCLINSTALL)
TCLSH		= "$(_INSTALLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
TCLSTUBLIB	= "$(_INSTALLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_INSTALLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_INSTALLDIR)\lib
TCLREGLIB	= "$(_INSTALLDIR)\lib\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_INSTALLDIR)\lib\tcldde12$(SUFX:t=).lib"
COFFBASE	= \must\have\tcl\sources\to\build\this\target
TCLTOOLSDIR	= \must\have\tcl\sources\to\build\this\target
!else
TCLSH		= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
TCLSTUBLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
TCLIMPLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
TCL_LIBRARY	= $(_TCLDIR)\library
TCLREGLIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg11$(SUFX:t=).lib"
TCLDDELIB	= "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde12$(SUFX:t=).lib"
COFFBASE	= "$(_TCLDIR)\win\coffbase.txt"
TCLTOOLSDIR	= $(_TCLDIR)\tools
!endif

!endif


#----------------------------------------------------------
# Display stats being used.
#----------------------------------------------------------

!message *** Intermediate directory will be '$(TMP_DIR)'
!message *** Output directory will be '$(OUT_DIR)'
!message *** Suffix for binaries will be '$(SUFX)'
!message *** Optional defines are '$(OPTDEFINES)'

!endif