Tk Source Code

Check-in [566953e5]
Login

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

Overview
Comment:Update missing symbols for tk-Cocoa
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tk-cocoa-8-5-backport
Files: files | file ages | folders
SHA1: 566953e562bda47a73d4207d770d8fc862718b09
User & Date: kevin_walzer 2011-11-04 00:17:27
Context
2012-01-29
18:02
Fix for serious bugs with input methods, and for display of certain fonts in buttons; thanks to Adrian Robert for extensive patches. check-in: 9844fe10 user: kevin_walzer tags: tk-cocoa-8-5-backport
2011-11-04
00:17
Update missing symbols for tk-Cocoa check-in: 566953e5 user: kevin_walzer tags: tk-cocoa-8-5-backport
2011-11-03
23:42
Further teweaking of Tk-Cocoa backport check-in: 058a8f61 user: kevin_walzer tags: tk-cocoa-8-5-backport
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkInt.h.

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


13
14
15
16
17
18
19
/*
 * tkInt.h --
 *
 *	Declarations for things used internally by the Tk functions but not
 *	exported outside the module.
 *
 * Copyright (c) 1990-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 1998 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.


 */

#ifndef _TKINT
#define _TKINT

#ifndef _TK
#include "tk.h"












>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * tkInt.h --
 *
 *	Declarations for things used internally by the Tk functions but not
 *	exported outside the module.
 *
 * Copyright (c) 1990-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 1998 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: $Id$
 */

#ifndef _TKINT
#define _TKINT

#ifndef _TK
#include "tk.h"
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
    char *charValuePtr;		/* A pointer to a string that holds the key's
				 * %A substitution text (before backslash
				 * adding), or NULL if that has not been
				 * computed yet. If non-NULL, this string was
				 * allocated with ckalloc(). */
    int charValueLen;		/* Length of string in charValuePtr when that
				 * is non-NULL. */
    KeySym keysym;		/* Key symbol computed after input methods
				 * have been invoked */
} TkKeyEvent;

/*
 * The following structure is used as a two way map between integers and
 * strings, usually to map between an internal C representation and the
 * strings used in Tcl.
 */







<
<







862
863
864
865
866
867
868


869
870
871
872
873
874
875
    char *charValuePtr;		/* A pointer to a string that holds the key's
				 * %A substitution text (before backslash
				 * adding), or NULL if that has not been
				 * computed yet. If non-NULL, this string was
				 * allocated with ckalloc(). */
    int charValueLen;		/* Length of string in charValuePtr when that
				 * is non-NULL. */


} TkKeyEvent;

/*
 * The following structure is used as a two way map between integers and
 * strings, usually to map between an internal C representation and the
 * strings used in Tcl.
 */
1175
1176
1177
1178
1179
1180
1181


1182
1183
1184
1185
1186
1187
1188
			    int *lengthPtr);
MODULE_SCOPE void	TkUnderlineCharsInContext(Display *display,
			    Drawable drawable, GC gc, Tk_Font tkfont,
			    const char *string, int numBytes, int x, int y,
			    int firstByte, int lastByte);
MODULE_SCOPE void	TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont,
			    Tcl_UniChar c, struct TkFontAttributes *faPtr);



/*
 * Unsupported commands.
 */

MODULE_SCOPE int	TkUnsupported1ObjCmd(ClientData clientData,
			    Tcl_Interp *interp, int objc,







>
>







1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
			    int *lengthPtr);
MODULE_SCOPE void	TkUnderlineCharsInContext(Display *display,
			    Drawable drawable, GC gc, Tk_Font tkfont,
			    const char *string, int numBytes, int x, int y,
			    int firstByte, int lastByte);
MODULE_SCOPE void	TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont,
			    Tcl_UniChar c, struct TkFontAttributes *faPtr);
MODULE_SCOPE int	TkBackgroundEvalObjv(Tcl_Interp *interp,
			    int objc, Tcl_Obj *const *objv, int flags);

/*
 * Unsupported commands.
 */

MODULE_SCOPE int	TkUnsupported1ObjCmd(ClientData clientData,
			    Tcl_Interp *interp, int objc,

Changes to generic/tkUtil.c.

1
2
3
4
5
6
7
8
9
10
11


12
13
14
15
16
17
18
/*
 * tkUtil.c --
 *
 *	This file contains miscellaneous utility functions that are used by
 *	the rest of Tk, such as a function for drawing a focus highlight.
 *
 * Copyright (c) 1994 The Regents of the University of California.
 * Copyright (c) 1994-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.


 */

#include "tkInt.h"

/*
 * The structure below defines the implementation of the "statekey" Tcl
 * object, used for quickly finding a mapping in a TkStateMap.











>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tkUtil.c --
 *
 *	This file contains miscellaneous utility functions that are used by
 *	the rest of Tk, such as a function for drawing a focus highlight.
 *
 * Copyright (c) 1994 The Regents of the University of California.
 * Copyright (c) 1994-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.
 *
 * RCS: @(#) $Id$
 */

#include "tkInt.h"

/*
 * The structure below defines the implementation of the "statekey" Tcl
 * object, used for quickly finding a mapping in a TkStateMap.
970
971
972
973
974
975
976
977
978



















































































979
980
981
982
983
984
	    Tcl_AppendResult(interp,
		((mPtr[1].strKey != NULL) ? ", " : ", or "),
		mPtr->strKey, NULL);
	}
    }
    return mPtr->numKey;
}

/*



















































































 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
	    Tcl_AppendResult(interp,
		((mPtr[1].strKey != NULL) ? ", " : ", or "),
		mPtr->strKey, NULL);
	}
    }
    return mPtr->numKey;
}

/*
 * ----------------------------------------------------------------------
 *
 * TkBackgroundEvalObjv --
 *
 *	Evaluate a command while ensuring that we do not affect the
 *	interpreters state. This is important when evaluating script
 *	during background tasks.
 *
 * Results:
 *	A standard Tcl result code.
 *
 * Side Effects:
 *	The interpreters variables and code may be modified by the script
 *	but the result will not be modified.
 *
 * ----------------------------------------------------------------------
 */

int
TkBackgroundEvalObjv(
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const *objv,
    int flags)
{
    Tcl_DString errorInfo, errorCode;
    Tcl_SavedResult state;
    int n, r = TCL_OK;

    Tcl_DStringInit(&errorInfo);
    Tcl_DStringInit(&errorCode);

    Tcl_Preserve(interp);

    /*
     * Record the state of the interpreter
     */

    Tcl_SaveResult(interp, &state);
    Tcl_DStringAppend(&errorInfo,
	Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY), -1);
    Tcl_DStringAppend(&errorCode,
	Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY), -1);

    /*
     * Evaluate the command and handle any error.
     */

    for (n = 0; n < objc; ++n) {
	Tcl_IncrRefCount(objv[n]);
    }
    r = Tcl_EvalObjv(interp, objc, objv, flags);
    for (n = 0; n < objc; ++n) {
	Tcl_DecrRefCount(objv[n]);
    }
    if (r == TCL_ERROR) {
        Tcl_AddErrorInfo(interp, "\n    (background event handler)");
        Tcl_BackgroundError(interp);
    }

    Tcl_Release(interp);

    /*
     * Restore the state of the interpreter
     */

    Tcl_SetVar(interp, "errorInfo",
	Tcl_DStringValue(&errorInfo), TCL_GLOBAL_ONLY);
    Tcl_SetVar(interp, "errorCode",
	Tcl_DStringValue(&errorCode), TCL_GLOBAL_ONLY);
    Tcl_RestoreResult(interp, &state);

    /*
     * Clean up references.
     */

    Tcl_DStringFree(&errorInfo);
    Tcl_DStringFree(&errorCode);

    return r;
}

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */

Changes to notes-on-backporting.txt.

13
14
15
16
17
18
19


20
21
22
23
unix/configure.in
unix/Makefile.in
unix/tcl.m4
xlib/xgc.c
generic/tk.decls
generic/tkPlatDecls.h
generic/tkIntPlatDecls.h



Check Sourceforge and/or Fossil for recent commits in Tk-Cocoa; these changes should be backported to the corresponding 8.5 file. This most likely will have to be done manually. 

Try building the package and running the widget demo--if it works, then call it ready for release.







>
>




13
14
15
16
17
18
19
20
21
22
23
24
25
unix/configure.in
unix/Makefile.in
unix/tcl.m4
xlib/xgc.c
generic/tk.decls
generic/tkPlatDecls.h
generic/tkIntPlatDecls.h
generic/tkInt.h
generic/tkUtil.c

Check Sourceforge and/or Fossil for recent commits in Tk-Cocoa; these changes should be backported to the corresponding 8.5 file. This most likely will have to be done manually. 

Try building the package and running the widget demo--if it works, then call it ready for release.