Check-in [d5338ed925]
Not logged in

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

Overview
Comment:add tk upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5338ed92534d04a31b3c9483412bab498ea9a4e
User & Date: chw 2019-07-04 05:41:28
Context
2019-07-04
15:31
add tcl upstream changes check-in: abe9b6607a user: chw tags: trunk
05:41
add tk upstream changes check-in: d5338ed925 user: chw tags: trunk
04:36
add patch from ticket [d7c10bb26f] check-in: 907e1f9b6e user: chw tags: trunk
Changes

Changes to jni/sdl2tk/doc/panedwindow.n.

327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
adjusted.
.PP
When a pane is resized from outside (e.g. it is packed to expand and
fill, and the containing toplevel is resized), space is added to the final
(rightmost or bottommost) pane in the window.
.PP
Unlike slave windows managed by e.g. pack or grid, the panes managed by a
panedwindow do not change width or height to accomodate changes in the
requested widths or heights of the panes, once these have become mapped.
Therefore it may be advisable, particularly when creating layouts
interactively, to not add a pane to the panedwindow widget until after the
geometry requests of that pane has been finalized (i.e., all components of
the pane inserted, all options affecting geometry set to their proper
values, etc.).
.SH "SEE ALSO"
ttk::panedwindow(n)
.SH KEYWORDS
panedwindow, widget, geometry management
'\" Local Variables:
'\" mode: nroff
'\" End:







|













327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
adjusted.
.PP
When a pane is resized from outside (e.g. it is packed to expand and
fill, and the containing toplevel is resized), space is added to the final
(rightmost or bottommost) pane in the window.
.PP
Unlike slave windows managed by e.g. pack or grid, the panes managed by a
panedwindow do not change width or height to accommodate changes in the
requested widths or heights of the panes, once these have become mapped.
Therefore it may be advisable, particularly when creating layouts
interactively, to not add a pane to the panedwindow widget until after the
geometry requests of that pane has been finalized (i.e., all components of
the pane inserted, all options affecting geometry set to their proper
values, etc.).
.SH "SEE ALSO"
ttk::panedwindow(n)
.SH KEYWORDS
panedwindow, widget, geometry management
'\" Local Variables:
'\" mode: nroff
'\" End:

Changes to jni/sdl2tk/doc/tk_mac.n.

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
}
.CE
.RE
.TP
\fB::tk::mac::OpenApplication\fR
.
If a proc of this name is defined, this proc fill fire when your application
is intially opened. It is the default Apple Event handler for
kAEOpenApplication,
.QW oapp .
.TP
\fB::tk::mac::ReopenApplication\fR
.
If a proc of this name is defined it is the default Apple Event handler for
kAEReopenApplication,







|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
}
.CE
.RE
.TP
\fB::tk::mac::OpenApplication\fR
.
If a proc of this name is defined, this proc fill fire when your application
is initially opened. It is the default Apple Event handler for
kAEOpenApplication,
.QW oapp .
.TP
\fB::tk::mac::ReopenApplication\fR
.
If a proc of this name is defined it is the default Apple Event handler for
kAEReopenApplication,

Changes to jni/sdl2tk/generic/tk3d.c.

1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
 * Results:
 *	The return value is a standard Tcl result. If an error occurs during
 *	conversion, an error message is left in the interpreter's result
 *	unless "interp" is NULL.
 *
 * Side effects:
 *	If no error occurs, a blank internal format for a border value is
 *	intialized. The final form cannot be done without a Tk_Window.
 *
 *----------------------------------------------------------------------
 */

static void
InitBorderObj(
    Tcl_Obj *objPtr)		/* The object to convert. */







|







1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
 * Results:
 *	The return value is a standard Tcl result. If an error occurs during
 *	conversion, an error message is left in the interpreter's result
 *	unless "interp" is NULL.
 *
 * Side effects:
 *	If no error occurs, a blank internal format for a border value is
 *	initialized. The final form cannot be done without a Tk_Window.
 *
 *----------------------------------------------------------------------
 */

static void
InitBorderObj(
    Tcl_Obj *objPtr)		/* The object to convert. */

Changes to jni/sdl2tk/generic/tkBitmap.c.

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 */

typedef struct {
    const char *source;		/* Bitmap bits. */
    int width, height;		/* Dimensions of bitmap. */
} DataKey;

typedef struct ThreadSpecificData {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable predefBitmapTable;
				/* Hash table created by Tk_DefineBitmap to
				 * map from a name to a collection of in-core
				 * data about a bitmap. The table is indexed
				 * by the address of the data for the bitmap,
				 * and the entries contain pointers to







|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 */

typedef struct {
    const char *source;		/* Bitmap bits. */
    int width, height;		/* Dimensions of bitmap. */
} DataKey;

typedef struct {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable predefBitmapTable;
				/* Hash table created by Tk_DefineBitmap to
				 * map from a name to a collection of in-core
				 * data about a bitmap. The table is indexed
				 * by the address of the data for the bitmap,
				 * and the entries contain pointers to

Changes to jni/sdl2tk/generic/tkButton.c.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"
#include "tkButton.h"
#include "default.h"

typedef struct ThreadSpecificData {
    int defaultsInitialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Class names for buttons, indexed by one of the type values defined in
 * tkButton.h.







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"
#include "tkButton.h"
#include "default.h"

typedef struct {
    int defaultsInitialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Class names for buttons, indexed by one of the type values defined in
 * tkButton.h.

Changes to jni/sdl2tk/generic/tkColor.c.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    Display *display;		/* Display for colormap. */
} ValueKey;

/*
 * The structure below is used to allocate thread-local data.
 */

typedef struct ThreadSpecificData {
    char rgbString[20];		/* */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Forward declarations for functions defined in this file:
 */







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    Display *display;		/* Display for colormap. */
} ValueKey;

/*
 * The structure below is used to allocate thread-local data.
 */

typedef struct {
    char rgbString[20];		/* */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Forward declarations for functions defined in this file:
 */

Changes to jni/sdl2tk/generic/tkConfig.c.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "tkFont.h"

/*
 * The following definition keeps track of all of
 * the option tables that have been created for a thread.
 */

typedef struct ThreadSpecificData {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable hashTable;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;


/*







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "tkFont.h"

/*
 * The following definition keeps track of all of
 * the option tables that have been created for a thread.
 */

typedef struct {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable hashTable;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;


/*

Changes to jni/sdl2tk/generic/tkEvent.c.

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

/*
 * The structure below is used to store Data for the Event module that must be
 * kept thread-local. The "dataKey" is used to fetch the thread-specific
 * storage for the current thread.
 */

typedef struct ThreadSpecificData {
    int handlersActive;		/* The following variable has a non-zero value
				 * when a handler is active. */
    InProgress *pendingPtr;	/* Topmost search in progress, or NULL if
				 * none. */

    /*
     * List of generic handler records.







|







138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

/*
 * The structure below is used to store Data for the Event module that must be
 * kept thread-local. The "dataKey" is used to fetch the thread-specific
 * storage for the current thread.
 */

typedef struct {
    int handlersActive;		/* The following variable has a non-zero value
				 * when a handler is active. */
    InProgress *pendingPtr;	/* Topmost search in progress, or NULL if
				 * none. */

    /*
     * List of generic handler records.

Changes to jni/sdl2tk/generic/tkGet.c.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * One of these structures is created per thread to store thread-specific
 * data. In this case, it is used to house the Tk_Uid structs used by each
 * thread. The "dataKey" below is used to locate the ThreadSpecificData for
 * the current thread.
 */

typedef struct ThreadSpecificData {
    int initialized;
    Tcl_HashTable uidTable;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static void		FreeUidThreadExitProc(ClientData clientData);








|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * One of these structures is created per thread to store thread-specific
 * data. In this case, it is used to house the Tk_Uid structs used by each
 * thread. The "dataKey" below is used to locate the ThreadSpecificData for
 * the current thread.
 */

typedef struct {
    int initialized;
    Tcl_HashTable uidTable;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static void		FreeUidThreadExitProc(ClientData clientData);

Changes to jni/sdl2tk/generic/tkGrid.c.

1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
....
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
				 * constraints. */
    int slotCount;		/* Last occupied row or column. */
    int gridCount;		/* The larger of slotCount and
				 * constraintCount. */
    GridLayout *layoutPtr;	/* Temporary layout structure. */
    int requiredSize;		/* The natural size of the grid (pixels).
				 * This is the minimum size needed to
				 * accomodate all of the slaves at their
				 * requested sizes. */
    int offset;			/* The pixel offset of the right edge of the
				 * current slot from the beginning of the
				 * layout. */
    int slot;			/* The current slot. */
    int start;			/* The first slot of a contiguous set whose
				 * constraints are not yet fully resolved. */
................................................................................
 *
 * Results:
 *	None
 *
 * Side effects:
 *	The width and height arguments are filled in the master data
 *	structure. Additional space is allocated for the constraints to
 *	accomodate the offsets.
 *
 *----------------------------------------------------------------------
 */

static void
SetGridSize(
    Gridder *masterPtr)		/* The geometry master for this grid. */







|







 







|







1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
....
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
				 * constraints. */
    int slotCount;		/* Last occupied row or column. */
    int gridCount;		/* The larger of slotCount and
				 * constraintCount. */
    GridLayout *layoutPtr;	/* Temporary layout structure. */
    int requiredSize;		/* The natural size of the grid (pixels).
				 * This is the minimum size needed to
				 * accommodate all of the slaves at their
				 * requested sizes. */
    int offset;			/* The pixel offset of the right edge of the
				 * current slot from the beginning of the
				 * layout. */
    int slot;			/* The current slot. */
    int start;			/* The first slot of a contiguous set whose
				 * constraints are not yet fully resolved. */
................................................................................
 *
 * Results:
 *	None
 *
 * Side effects:
 *	The width and height arguments are filled in the master data
 *	structure. Additional space is allocated for the constraints to
 *	accommodate the offsets.
 *
 *----------------------------------------------------------------------
 */

static void
SetGridSize(
    Gridder *masterPtr)		/* The geometry master for this grid. */

Changes to jni/sdl2tk/generic/tkImage.c.

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    Image *instancePtr;		/* Pointer to first in list of instances
				 * derived from this name. */
    int deleted;		/* Flag set when image is being deleted. */
    TkWindow *winPtr;		/* Main window of interpreter (used to detect
				 * when the world is falling apart.) */
} ImageMaster;

typedef struct ThreadSpecificData {
    Tk_ImageType *imageTypeList;/* First in a list of all known image
				 * types. */
    Tk_ImageType *oldImageTypeList;
				/* First in a list of all known old-style
				 * image types. */
    int initialized;		/* Set to 1 if we've initialized the
				 * structure. */







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    Image *instancePtr;		/* Pointer to first in list of instances
				 * derived from this name. */
    int deleted;		/* Flag set when image is being deleted. */
    TkWindow *winPtr;		/* Main window of interpreter (used to detect
				 * when the world is falling apart.) */
} ImageMaster;

typedef struct {
    Tk_ImageType *imageTypeList;/* First in a list of all known image
				 * types. */
    Tk_ImageType *oldImageTypeList;
				/* First in a list of all known old-style
				 * image types. */
    int initialized;		/* Set to 1 if we've initialized the
				 * structure. */

Changes to jni/sdl2tk/generic/tkImgGIF.c.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
} MFile;

/*
 * Non-ASCII encoding support:
 * Most data in a GIF image is binary and is treated as such. However, a few
 * key bits are stashed in ASCII. If we try to compare those pieces to the
 * char they represent, it will fail on any non-ASCII (eg, EBCDIC) system. To
 * accomodate these systems, we test against the numeric value of the ASCII
 * characters instead of the characters themselves. This is encoding
 * independant.
 */

static const char GIF87a[] = {			/* ASCII GIF87a */
    0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x00
};
static const char GIF89a[] = {			/* ASCII GIF89a */
    0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x00







|

|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
} MFile;

/*
 * Non-ASCII encoding support:
 * Most data in a GIF image is binary and is treated as such. However, a few
 * key bits are stashed in ASCII. If we try to compare those pieces to the
 * char they represent, it will fail on any non-ASCII (eg, EBCDIC) system. To
 * accommodate these systems, we test against the numeric value of the ASCII
 * characters instead of the characters themselves. This is encoding
 * independent.
 */

static const char GIF87a[] = {			/* ASCII GIF87a */
    0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x00
};
static const char GIF89a[] = {			/* ASCII GIF89a */
    0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x00

Changes to jni/sdl2tk/generic/tkImgPhoto.c.

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
    TkImgPhotoFree,		/* freeProc */
    ImgPhotoDelete,		/* deleteProc */
    ImgPhotoPostscript,		/* postscriptProc */
    NULL,			/* nextPtr */
    NULL
};

typedef struct ThreadSpecificData {
    Tk_PhotoImageFormat *formatList;
				/* Pointer to the first in the list of known
				 * photo image formats.*/
    Tk_PhotoImageFormat *oldFormatList;
				/* Pointer to the first in the list of known
				 * photo image formats.*/
    int initialized;		/* Set to 1 if we've initialized the







|







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
    TkImgPhotoFree,		/* freeProc */
    ImgPhotoDelete,		/* deleteProc */
    ImgPhotoPostscript,		/* postscriptProc */
    NULL,			/* nextPtr */
    NULL
};

typedef struct {
    Tk_PhotoImageFormat *formatList;
				/* Pointer to the first in the list of known
				 * photo image formats.*/
    Tk_PhotoImageFormat *oldFormatList;
				/* Pointer to the first in the list of known
				 * photo image formats.*/
    int initialized;		/* Set to 1 if we've initialized the

Changes to jni/sdl2tk/generic/tkMacWinMenu.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"
#include "tkMenu.h"

typedef struct ThreadSpecificData {
    int postCommandGeneration;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static int		PreprocessMenu(TkMenu *menuPtr);
 
/*







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkInt.h"
#include "tkMenu.h"

typedef struct {
    int postCommandGeneration;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static int		PreprocessMenu(TkMenu *menuPtr);
 
/*

Changes to jni/sdl2tk/generic/tkMenu.c.

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

#include "tkInt.h"
#include "tkMenu.h"

#define MENU_HASH_KEY "tkMenus"

typedef struct ThreadSpecificData {
    int menusInitialized;	/* Flag indicates whether thread-specific
				 * elements of the Windows Menu module have
				 * been initialized. */
    Tk_OptionTable menuOptionTable;
				/* The option table for menus. */
    Tk_OptionTable entryOptionTables[6];
				/* The tables for menu entries. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * The following flag indicates whether the process-wide state for the Menu
 * module has been intialized. The Mutex protects access to that flag.
 */

static int menusInitialized;
TCL_DECLARE_MUTEX(menuMutex)

/*
 * Configuration specs for individual menu entries. If this changes, be sure







|












|







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

#include "tkInt.h"
#include "tkMenu.h"

#define MENU_HASH_KEY "tkMenus"

typedef struct {
    int menusInitialized;	/* Flag indicates whether thread-specific
				 * elements of the Windows Menu module have
				 * been initialized. */
    Tk_OptionTable menuOptionTable;
				/* The option table for menus. */
    Tk_OptionTable entryOptionTables[6];
				/* The tables for menu entries. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * The following flag indicates whether the process-wide state for the Menu
 * module has been initialized. The Mutex protects access to that flag.
 */

static int menusInitialized;
TCL_DECLARE_MUTEX(menuMutex)

/*
 * Configuration specs for individual menu entries. If this changes, be sure

Changes to jni/sdl2tk/generic/tkObj.c.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
..
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
 * One of these structures is created per thread to store thread-specific
 * data. In this case, it is used to contain references to selected
 * Tcl_ObjTypes that we can use as screen distances without conversion. The
 * "dataKey" below is used to locate the ThreadSpecificData for the current
 * thread.
 */

typedef struct ThreadSpecificData {
    const Tcl_ObjType *doubleTypePtr;
    const Tcl_ObjType *intTypePtr;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * The following structure is the internal representation for mm objects.
................................................................................
static int		SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int		SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int		SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);

/*
 * The following structure defines the implementation of the "pixel" Tcl
 * object, used for measuring distances. The pixel object remembers its
 * initial display-independant settings.
 */

static const Tcl_ObjType pixelObjType = {
    "pixel",			/* name */
    FreePixelInternalRep,	/* freeIntRepProc */
    DupPixelInternalRep,	/* dupIntRepProc */
    NULL,			/* updateStringProc */
    SetPixelFromAny		/* setFromAnyProc */
};

/*
 * The following structure defines the implementation of the "pixel" Tcl
 * object, used for measuring distances. The pixel object remembers its
 * initial display-independant settings.
 */

static const Tcl_ObjType mmObjType = {
    "mm",			/* name */
    FreeMMInternalRep,		/* freeIntRepProc */
    DupMMInternalRep,		/* dupIntRepProc */
    UpdateStringOfMM,		/* updateStringProc */







|







 







|













|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
..
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
 * One of these structures is created per thread to store thread-specific
 * data. In this case, it is used to contain references to selected
 * Tcl_ObjTypes that we can use as screen distances without conversion. The
 * "dataKey" below is used to locate the ThreadSpecificData for the current
 * thread.
 */

typedef struct {
    const Tcl_ObjType *doubleTypePtr;
    const Tcl_ObjType *intTypePtr;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * The following structure is the internal representation for mm objects.
................................................................................
static int		SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int		SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
static int		SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);

/*
 * The following structure defines the implementation of the "pixel" Tcl
 * object, used for measuring distances. The pixel object remembers its
 * initial display-independent settings.
 */

static const Tcl_ObjType pixelObjType = {
    "pixel",			/* name */
    FreePixelInternalRep,	/* freeIntRepProc */
    DupPixelInternalRep,	/* dupIntRepProc */
    NULL,			/* updateStringProc */
    SetPixelFromAny		/* setFromAnyProc */
};

/*
 * The following structure defines the implementation of the "pixel" Tcl
 * object, used for measuring distances. The pixel object remembers its
 * initial display-independent settings.
 */

static const Tcl_ObjType mmObjType = {
    "mm",			/* name */
    FreeMMInternalRep,		/* freeIntRepProc */
    DupMMInternalRep,		/* dupIntRepProc */
    UpdateStringOfMM,		/* updateStringProc */

Changes to jni/sdl2tk/generic/tkOldTest.c.

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

 
/*
 *----------------------------------------------------------------------
 *
 * TkOldTestInit --
 *
 *	This function performs intialization for the Tk test suite
 *	extensions for testing support for legacy interfaces.
 *
 * Results:
 *	Returns a standard Tcl completion code, and leaves an error message in
 *	the interp's result if an error occurs.
 *
 * Side effects:







|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

 
/*
 *----------------------------------------------------------------------
 *
 * TkOldTestInit --
 *
 *	This function performs initialization for the Tk test suite
 *	extensions for testing support for legacy interfaces.
 *
 * Results:
 *	Returns a standard Tcl completion code, and leaves an error message in
 *	the interp's result if an error occurs.
 *
 * Side effects:

Changes to jni/sdl2tk/generic/tkOption.c.

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
				 * level. */
    int bases[NUM_STACKS];	/* For each stack, index of first element on
				 * stack corresponding to this level (used to
				 * restore "numUsed" fields when popping out
				 * of a level. */
} StackLevel;

typedef struct ThreadSpecificData {
    int initialized;		/* 0 means the ThreadSpecific Data structure
				 * for the current thread needs to be
				 * initialized. */
    ElArray *stacks[NUM_STACKS];
    TkWindow *cachedWindow;	/* Lowest-level window currently loaded in
				 * stacks at present. NULL means stacks have
				 * never been used, or have been invalidated







|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
				 * level. */
    int bases[NUM_STACKS];	/* For each stack, index of first element on
				 * stack corresponding to this level (used to
				 * restore "numUsed" fields when popping out
				 * of a level. */
} StackLevel;

typedef struct {
    int initialized;		/* 0 means the ThreadSpecific Data structure
				 * for the current thread needs to be
				 * initialized. */
    ElArray *stacks[NUM_STACKS];
    TkWindow *cachedWindow;	/* Lowest-level window currently loaded in
				 * stacks at present. NULL means stacks have
				 * never been used, or have been invalidated

Changes to jni/sdl2tk/generic/tkPointer.c.

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#define ALL_BUTTONS \
	(Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
static const unsigned int buttonMasks[] = {
    Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
};
#define ButtonMask(b) (buttonMasks[(b)-Button1])

typedef struct ThreadSpecificData {
    TkWindow *grabWinPtr;	/* Window that defines the top of the grab
				 * tree in a global grab. */
    int lastState;		/* Last known state flags. */
    XPoint lastPos;		/* Last reported mouse position. */
    TkWindow *lastWinPtr;	/* Last reported mouse window. */
    TkWindow *restrictWinPtr;	/* Window to which all mouse events will be
				 * reported. */







|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#define ALL_BUTTONS \
	(Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
static const unsigned int buttonMasks[] = {
    Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
};
#define ButtonMask(b) (buttonMasks[(b)-Button1])

typedef struct {
    TkWindow *grabWinPtr;	/* Window that defines the top of the grab
				 * tree in a global grab. */
    int lastState;		/* Last known state flags. */
    XPoint lastPos;		/* Last reported mouse position. */
    TkWindow *lastWinPtr;	/* Last reported mouse window. */
    TkWindow *restrictWinPtr;	/* Window to which all mouse events will be
				 * reported. */

Changes to jni/sdl2tk/generic/tkSelect.c.

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    Tcl_Obj *cmdObj;		/* Reference to command to invoke. */
} LostCommand;

/*
 * The structure below is used to keep each thread's pending list separate.
 */

typedef struct ThreadSpecificData {
    TkSelInProgress *pendingPtr;
				/* Topmost search in progress, or NULL if
				 * none. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    Tcl_Obj *cmdObj;		/* Reference to command to invoke. */
} LostCommand;

/*
 * The structure below is used to keep each thread's pending list separate.
 */

typedef struct {
    TkSelInProgress *pendingPtr;
				/* Topmost search in progress, or NULL if
				 * none. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*

Changes to jni/sdl2tk/generic/tkStyle.c.

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
				 * (by a derived element). */
} Element;

/*
 * Thread-local data.
 */

typedef struct ThreadSpecificData {
    int nbInit;			/* Number of calls to the init proc. */
    Tcl_HashTable engineTable;	/* Map a name to a style engine. Keys are
				 * strings, values are Tk_StyleEngine
				 * pointers. */
    StyleEngine *defaultEnginePtr;
				/* Default, core-defined style engine. Global
				 * fallback for all engines. */







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
				 * (by a derived element). */
} Element;

/*
 * Thread-local data.
 */

typedef struct {
    int nbInit;			/* Number of calls to the init proc. */
    Tcl_HashTable engineTable;	/* Map a name to a style engine. Keys are
				 * strings, values are Tk_StyleEngine
				 * pointers. */
    StyleEngine *defaultEnginePtr;
				/* Default, core-defined style engine. Global
				 * fallback for all engines. */

Changes to jni/sdl2tk/generic/tkTest.c.

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
			    XEvent *eventPtr);
 
/*
 *----------------------------------------------------------------------
 *
 * Tktest_Init --
 *
 *	This function performs intialization for the Tk test suite exensions.
 *
 * Results:
 *	Returns a standard Tcl completion code, and leaves an error message in
 *	the interp's result if an error occurs.
 *
 * Side effects:
 *	Creates several test commands.







|







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
			    XEvent *eventPtr);
 
/*
 *----------------------------------------------------------------------
 *
 * Tktest_Init --
 *
 *	This function performs initialization for the Tk test suite extensions.
 *
 * Results:
 *	Returns a standard Tcl completion code, and leaves an error message in
 *	the interp's result if an error occurs.
 *
 * Side effects:
 *	Creates several test commands.

Changes to jni/sdl2tk/generic/tkWindow.c.

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

typedef struct TkHalfdeadWindow {
    int flags;
    struct TkWindow *winPtr;
    struct TkHalfdeadWindow *nextPtr;
} TkHalfdeadWindow;

typedef struct ThreadSpecificData {
    int numMainWindows;		/* Count of numver of main windows currently
				 * open in this thread. */
    TkMainInfo *mainWindowList;
				/* First in list of all main windows managed
				 * by this thread. */
    TkHalfdeadWindow *halfdeadWindowList;
				/* First in list of partially deallocated







|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

typedef struct TkHalfdeadWindow {
    int flags;
    struct TkWindow *winPtr;
    struct TkHalfdeadWindow *nextPtr;
} TkHalfdeadWindow;

typedef struct {
    int numMainWindows;		/* Count of numver of main windows currently
				 * open in this thread. */
    TkMainInfo *mainWindowList;
				/* First in list of all main windows managed
				 * by this thread. */
    TkHalfdeadWindow *halfdeadWindowList;
				/* First in list of partially deallocated

Changes to jni/sdl2tk/macosx/tkMacOSXFont.c.

1
2
3
4
5
6
7
8
9
10
11
/*
 * tkMacOSXFont.c --
 *
 *	Contains the Macintosh implementation of the platform-independant font
 *	package interface.
 *
 * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
 * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright 2008-2009, Apple Inc.
 *
 * See the file "license.terms" for information on usage and redistribution



|







1
2
3
4
5
6
7
8
9
10
11
/*
 * tkMacOSXFont.c --
 *
 *	Contains the Macintosh implementation of the platform-independent font
 *	package interface.
 *
 * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de
 * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright 2008-2009, Apple Inc.
 *
 * See the file "license.terms" for information on usage and redistribution

Changes to jni/sdl2tk/macosx/tkMacOSXFont.h.

1
2
3
4
5
6
7
8
9
10
11
/*
 * tkMacOSXFont.h --
 *
 *	Contains the Macintosh implementation of the platform-independant
 *	font package interface.
 *
 * Copyright (c) 1990-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright 2001-2009, Apple Inc.
 * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
 *



|







1
2
3
4
5
6
7
8
9
10
11
/*
 * tkMacOSXFont.h --
 *
 *	Contains the Macintosh implementation of the platform-independent
 *	font package interface.
 *
 * Copyright (c) 1990-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright 2001-2009, Apple Inc.
 * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net>
 *

Changes to jni/sdl2tk/sdl/tkSDLEmbed.c.

40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
				 * in this process. Note that this is *not*
				 * the same window as wrapper: wrapper is the
				 * parent of embeddedPtr. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct ThreadSpecificData {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*







|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
				 * in this process. Note that this is *not*
				 * the same window as wrapper: wrapper is the
				 * parent of embeddedPtr. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*

Changes to jni/sdl2tk/sdl/tkSDLEvent.c.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.
 */

typedef struct ThreadSpecificData {
    int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Prototypes for functions that are referenced only in this file:
 */







|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.
 */

typedef struct {
    int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Prototypes for functions that are referenced only in this file:
 */

Changes to jni/sdl2tk/sdl/tkSDLFont.c.

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
 */

typedef struct FontAttributes {
    TkFontAttributes fa;
    TkXLFDAttributes xa;
} FontAttributes;

typedef struct ThreadSpecificData {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    FontFamily controlFamily;	/* FontFamily used to handle control character
				 * expansions. The encoding of this FontFamily







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
 */

typedef struct FontAttributes {
    TkFontAttributes fa;
    TkXLFDAttributes xa;
} FontAttributes;

typedef struct {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    FontFamily controlFamily;	/* FontFamily used to handle control character
				 * expansions. The encoding of this FontFamily

Changes to jni/sdl2tk/sdl/tkSDLSend.c.

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    int gotResponse;		/* 1 means a response has been received, 0
				 * means the command is still outstanding. */
    struct PendingCommand *nextPtr;
				/* Next in list of all outstanding commands.
				 * NULL means end of list. */
} PendingCommand;

typedef struct ThreadSpecificData {
    PendingCommand *pendingCommands;
				/* List of all commands currently being waited
				 * for. */
    RegisteredInterp *interpListPtr;
				/* List of all interpreters registered in the
				 * current process. */
} ThreadSpecificData;







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    int gotResponse;		/* 1 means a response has been received, 0
				 * means the command is still outstanding. */
    struct PendingCommand *nextPtr;
				/* Next in list of all outstanding commands.
				 * NULL means end of list. */
} PendingCommand;

typedef struct {
    PendingCommand *pendingCommands;
				/* List of all commands currently being waited
				 * for. */
    RegisteredInterp *interpListPtr;
				/* List of all interpreters registered in the
				 * current process. */
} ThreadSpecificData;

Changes to jni/sdl2tk/tests/menuDraw.test.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
} -body {
    menu .m1
} -cleanup {
    deleteWindows
} -result {.m1}


test menuDraw-2.1 {TkIntializeMenuEntryDrawingFields} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command
} -cleanup {
    deleteWindows
} -result {}







|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
} -body {
    menu .m1
} -cleanup {
    deleteWindows
} -result {.m1}


test menuDraw-2.1 {TkInitializeMenuEntryDrawingFields} -setup {
    deleteWindows
} -body {
    menu .m1
    .m1 add command
} -cleanup {
    deleteWindows
} -result {}

Changes to jni/sdl2tk/unix/tkUnixEmbed.c.

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
....
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
				 * in this process. Note that this is *not*
				 * the same window as wrapper: wrapper is the
				 * parent of embeddedPtr. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct ThreadSpecificData {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
................................................................................
	 * non-MacIntosh window systems (Win32 and X11). Tk doesn't reset the
	 * pointers to the parent window when the menu is reparented (since
	 * winPtr->parentPtr points to the wrong window). We get around this
	 * by determining the parent via the native API calls.
	 */

	if (XQueryTree(Tk_Display(tkRef), Tk_WindowId(tkRef), &root,
		&parent, &dummy, &count)) {
	    if (dummy != NULL) {
		XFree((void *) dummy);
	    }
	    *parentPtr = parent;
	} else {
	    *parentPtr = None;
	}







|







 







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
....
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
				 * in this process. Note that this is *not*
				 * the same window as wrapper: wrapper is the
				 * parent of embeddedPtr. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
................................................................................
	 * non-MacIntosh window systems (Win32 and X11). Tk doesn't reset the
	 * pointers to the parent window when the menu is reparented (since
	 * winPtr->parentPtr points to the wrong window). We get around this
	 * by determining the parent via the native API calls.
	 */

	if (XQueryTree(Tk_Display(tkRef), Tk_WindowId(tkRef), &root,
		&parent, &dummy, &count) > 0) {
	    if (dummy != NULL) {
		XFree((void *) dummy);
	    }
	    *parentPtr = parent;
	} else {
	    *parentPtr = None;
	}

Changes to jni/sdl2tk/unix/tkUnixEvent.c.

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.
 */

typedef struct ThreadSpecificData {
    int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Prototypes for functions that are referenced only in this file:
 */







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#endif

/*
 * The following static indicates whether this module has been initialized in
 * the current thread.
 */

typedef struct {
    int initialized;
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Prototypes for functions that are referenced only in this file:
 */

Changes to jni/sdl2tk/unix/tkUnixFont.c.

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
 */

typedef struct FontAttributes {
    TkFontAttributes fa;
    TkXLFDAttributes xa;
} FontAttributes;

typedef struct ThreadSpecificData {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    FontFamily controlFamily;	/* FontFamily used to handle control character
				 * expansions. The encoding of this FontFamily







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
 */

typedef struct FontAttributes {
    TkFontAttributes fa;
    TkXLFDAttributes xa;
} FontAttributes;

typedef struct {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    FontFamily controlFamily;	/* FontFamily used to handle control character
				 * expansions. The encoding of this FontFamily

Changes to jni/sdl2tk/unix/tkUnixRFont.c.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
} UnixFtFont;

/*
 * Used to describe the current clipping box. Can't be passed normally because
 * the information isn't retrievable from the GC.
 */

typedef struct ThreadSpecificData {
    Region clipRegion;		/* The clipping region, or NULL. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
 
/*
 * Package initialization:
 * 	Nothing to do here except register the fact that we're using Xft in
................................................................................
#define TCL_CFGVAL_ENCODING "ascii"
#endif

void
TkpFontPkgInit(
    TkMainInfo *mainPtr)	/* The application being created. */
{
    static Tcl_Config cfg[] = {
	{ "fontsystem", "xft" },
	{ 0,0 }
    };

    Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING);
}
 







|







 







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
} UnixFtFont;

/*
 * Used to describe the current clipping box. Can't be passed normally because
 * the information isn't retrievable from the GC.
 */

typedef struct {
    Region clipRegion;		/* The clipping region, or NULL. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
 
/*
 * Package initialization:
 * 	Nothing to do here except register the fact that we're using Xft in
................................................................................
#define TCL_CFGVAL_ENCODING "ascii"
#endif

void
TkpFontPkgInit(
    TkMainInfo *mainPtr)	/* The application being created. */
{
    static const Tcl_Config cfg[] = {
	{ "fontsystem", "xft" },
	{ 0,0 }
    };

    Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING);
}
 

Changes to jni/sdl2tk/unix/tkUnixSelect.c.

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    Time time;			/* Timestamp corresponding to selection at
				 * beginning of request; used to abort
				 * transfer if selection changes. */
    struct IncrInfo *nextPtr;	/* Next in list of all INCR-style retrievals
				 * currently pending. */
} IncrInfo;

typedef struct ThreadSpecificData {
    IncrInfo *pendingIncrs;	/* List of all incr structures currently
				 * active. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Largest property that we'll accept when sending or receiving the selection:







|







64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    Time time;			/* Timestamp corresponding to selection at
				 * beginning of request; used to abort
				 * transfer if selection changes. */
    struct IncrInfo *nextPtr;	/* Next in list of all INCR-style retrievals
				 * currently pending. */
} IncrInfo;

typedef struct {
    IncrInfo *pendingIncrs;	/* List of all incr structures currently
				 * active. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Largest property that we'll accept when sending or receiving the selection:

Changes to jni/sdl2tk/unix/tkUnixSend.c.

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    int gotResponse;		/* 1 means a response has been received, 0
				 * means the command is still outstanding. */
    struct PendingCommand *nextPtr;
				/* Next in list of all outstanding commands.
				 * NULL means end of list. */
} PendingCommand;

typedef struct ThreadSpecificData {
    PendingCommand *pendingCommands;
				/* List of all commands currently being waited
				 * for. */
    RegisteredInterp *interpListPtr;
				/* List of all interpreters registered in the
				 * current process. */
} ThreadSpecificData;







|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    int gotResponse;		/* 1 means a response has been received, 0
				 * means the command is still outstanding. */
    struct PendingCommand *nextPtr;
				/* Next in list of all outstanding commands.
				 * NULL means end of list. */
} PendingCommand;

typedef struct {
    PendingCommand *pendingCommands;
				/* List of all commands currently being waited
				 * for. */
    RegisteredInterp *interpListPtr;
				/* List of all interpreters registered in the
				 * current process. */
} ThreadSpecificData;

Changes to jni/sdl2tk/win/tkWinButton.c.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

/*
 * Cached information about the boxes bitmap, and the default border width for
 * a button in string form for use in Tk_OptionSpec for the various button
 * widget classes.
 */

typedef struct ThreadSpecificData {
    BITMAPINFOHEADER *boxesPtr;	/* Information about the bitmap. */
    DWORD *boxesPalette;	/* Pointer to color palette. */
    LPSTR boxesBits;		/* Pointer to bitmap data. */
    DWORD boxHeight;		/* Height of each sub-image. */
    DWORD boxWidth;		/* Width of each sub-image. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

/*
 * Cached information about the boxes bitmap, and the default border width for
 * a button in string form for use in Tk_OptionSpec for the various button
 * widget classes.
 */

typedef struct {
    BITMAPINFOHEADER *boxesPtr;	/* Information about the bitmap. */
    DWORD *boxesPalette;	/* Pointer to color palette. */
    LPSTR boxesBits;		/* Pointer to bitmap data. */
    DWORD boxHeight;		/* Height of each sub-image. */
    DWORD boxWidth;		/* Width of each sub-image. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

Changes to jni/sdl2tk/win/tkWinDialog.c.

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
....
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
....
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
#ifdef UNICODE
#define BFFM_VALIDATEFAILED 4
#else
#define BFFM_VALIDATEFAILED 3
#endif
#endif /* BFFM_VALIDATEFAILED */

typedef struct ThreadSpecificData {
    int debugFlag;		/* Flags whether we should output debugging
				 * information while displaying a builtin
				 * dialog. */
    Tcl_Interp *debugInterp;	/* Interpreter to used for debugging. */
    UINT WM_LBSELCHANGED;	/* Holds a registered windows event used for
				 * communicating between the Directory Chooser
				 * dialog and its hook proc. */
................................................................................
     */

    cdlgerr = CommDlgExtendedError();

    /*
     * We now allow FNERR_BUFFERTOOSMALL when multiselection is enabled. The
     * filename buffer has been dynamically allocated by the OFN dialog
     * procedure to accomodate all selected files.
     */

    if ((winCode != 0)
	    || ((cdlgerr == FNERR_BUFFERTOOSMALL)
		    && (ofn.Flags & OFN_ALLOWMULTISELECT))) {
	int gotFilename = 0;	/* Flag for tracking whether we have any
				 * filename at all. For details, see
................................................................................
	    SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0);
	}
	UpdateWindow(hwnd);
	return 1;

    case BFFM_INITIALIZED: {
	/*
	 * Directory browser intializing - tell it where to start from, user
	 * specified parameter.
	 */

	TCHAR *initDir = chooseDirSharedData->initDir;

	SetCurrentDirectory(initDir);








|







 







|







 







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
....
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
....
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
#ifdef UNICODE
#define BFFM_VALIDATEFAILED 4
#else
#define BFFM_VALIDATEFAILED 3
#endif
#endif /* BFFM_VALIDATEFAILED */

typedef struct {
    int debugFlag;		/* Flags whether we should output debugging
				 * information while displaying a builtin
				 * dialog. */
    Tcl_Interp *debugInterp;	/* Interpreter to used for debugging. */
    UINT WM_LBSELCHANGED;	/* Holds a registered windows event used for
				 * communicating between the Directory Chooser
				 * dialog and its hook proc. */
................................................................................
     */

    cdlgerr = CommDlgExtendedError();

    /*
     * We now allow FNERR_BUFFERTOOSMALL when multiselection is enabled. The
     * filename buffer has been dynamically allocated by the OFN dialog
     * procedure to accommodate all selected files.
     */

    if ((winCode != 0)
	    || ((cdlgerr == FNERR_BUFFERTOOSMALL)
		    && (ofn.Flags & OFN_ALLOWMULTISELECT))) {
	int gotFilename = 0;	/* Flag for tracking whether we have any
				 * filename at all. For details, see
................................................................................
	    SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0);
	}
	UpdateWindow(hwnd);
	return 1;

    case BFFM_INITIALIZED: {
	/*
	 * Directory browser initializing - tell it where to start from, user
	 * specified parameter.
	 */

	TCHAR *initDir = chooseDirSharedData->initDir;

	SetCurrentDirectory(initDir);

Changes to jni/sdl2tk/win/tkWinDraw.c.

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

/*
 * The followng typedef is used to pass Windows GDI drawing functions.
 */

typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, const POINT *points, int npoints);

typedef struct ThreadSpecificData {
    POINT *winPoints;		/* Array of points that is reused. */
    int nWinPoints;		/* Current size of point array. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Forward declarations for functions defined in this file:







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

/*
 * The followng typedef is used to pass Windows GDI drawing functions.
 */

typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, const POINT *points, int npoints);

typedef struct {
    POINT *winPoints;		/* Array of points that is reused. */
    int nWinPoints;		/* Current size of point array. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*
 * Forward declarations for functions defined in this file:

Changes to jni/sdl2tk/win/tkWinEmbed.c.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
				 * or NULL if the embedded application isn't
				 * in this process. */
    HWND embeddedMenuHWnd;	/* Tk's embedded menu window handler. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct ThreadSpecificData {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static void		ContainerEventProc(ClientData clientData,







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
				 * or NULL if the embedded application isn't
				 * in this process. */
    HWND embeddedMenuHWnd;	/* Tk's embedded menu window handler. */
    struct Container *nextPtr;	/* Next in list of all containers in this
				 * process. */
} Container;

typedef struct {
    Container *firstContainerPtr;
				/* First in list of all containers managed by
				 * this process. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

static void		ContainerEventProc(ClientData clientData,

Changes to jni/sdl2tk/win/tkWinFont.c.

1
2
3
4
5
6
7
8
9
10
11
...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
 * tkWinFont.c --
 *
 *	Contains the Windows implementation of the platform-independant font
 *	package interface.
 *
 * Copyright (c) 1994 Software Research Associates, Inc.
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
................................................................................
    {DEFAULT_GUI_FONT,	    "defaultgui"},
    {OEM_FIXED_FONT,	    "oemfixed"},
    {SYSTEM_FIXED_FONT,	    "systemfixed"},
    {SYSTEM_FONT,	    "system"},
    {-1,		    NULL}
};

typedef struct ThreadSpecificData {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    Tcl_HashTable uidTable;
} ThreadSpecificData;



|







 







|







1
2
3
4
5
6
7
8
9
10
11
...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
 * tkWinFont.c --
 *
 *	Contains the Windows implementation of the platform-independent font
 *	package interface.
 *
 * Copyright (c) 1994 Software Research Associates, Inc.
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
................................................................................
    {DEFAULT_GUI_FONT,	    "defaultgui"},
    {OEM_FIXED_FONT,	    "oemfixed"},
    {SYSTEM_FIXED_FONT,	    "systemfixed"},
    {SYSTEM_FONT,	    "system"},
    {-1,		    NULL}
};

typedef struct {
    FontFamily *fontFamilyList; /* The list of font families that are
				 * currently loaded. As screen fonts are
				 * loaded, this list grows to hold information
				 * about what characters exist in each font
				 * family. */
    Tcl_HashTable uidTable;
} ThreadSpecificData;

Changes to jni/sdl2tk/win/tkWinMenu.c.

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
static int indicatorDimensions[2];
				/* The dimensions of the indicator space in a
				 * menu entry. Calculated at init time to save
				 * time. */

static BOOL showMenuAccelerators;

typedef struct ThreadSpecificData {
    int inPostMenu;		/* We cannot be re-entrant like X Windows. */
    WORD lastCommandID;		/* The last command ID we allocated. */
    HWND menuHWND;		/* A window to service popup-menu messages
				 * in. */
    HWND embeddedMenuHWND;	/* A window to service embedded menu
				 * messages */
    int oldServiceMode;		/* Used while processing a menu; we need to







|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
static int indicatorDimensions[2];
				/* The dimensions of the indicator space in a
				 * menu entry. Calculated at init time to save
				 * time. */

static BOOL showMenuAccelerators;

typedef struct {
    int inPostMenu;		/* We cannot be re-entrant like X Windows. */
    WORD lastCommandID;		/* The last command ID we allocated. */
    HWND menuHWND;		/* A window to service popup-menu messages
				 * in. */
    HWND embeddedMenuHWND;	/* A window to service embedded menu
				 * messages */
    int oldServiceMode;		/* Used while processing a menu; we need to

Changes to jni/sdl2tk/win/tkWinWindow.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkWinInt.h"
#include "tkBusy.h"

typedef struct ThreadSpecificData {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable windowTable;  /* The windowTable maps from HWND to Tk_Window
				 * handles. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "tkWinInt.h"
#include "tkBusy.h"

typedef struct {
    int initialized;		/* 0 means table below needs initializing. */
    Tcl_HashTable windowTable;  /* The windowTable maps from HWND to Tk_Window
				 * handles. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;

/*

Changes to jni/sdl2tk/win/tkWinWm.c.

363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
....
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478

static const Tk_GeomMgr wmMgrType = {
    "wm",			/* name */
    TopLevelReqProc,		/* requestProc */
    NULL,			/* lostSlaveProc */
};

typedef struct ThreadSpecificData {
    HPALETTE systemPalette;	/* System palette; refers to the currently
				 * installed foreground logical palette. */
    TkWindow *createWindow;	/* Window that is being constructed. This
				 * value is set immediately before a call to
				 * CreateWindowEx, and is used by SetLimits.
				 * This is a gross hack needed to work around
				 * Windows brain damage where it sends the
................................................................................
	 * converts them as required. Initialise icon info structure.
	 */

	ZeroMemory(&iconInfo, sizeof(iconInfo));
	iconInfo.fIcon = TRUE;

	/*
	 * Create device-independant color bitmap.
	 */

	ZeroMemory(&bmInfo, sizeof bmInfo);
	bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	bmInfo.bmiHeader.biWidth = width;
	bmInfo.bmiHeader.biHeight = -height;
	bmInfo.bmiHeader.biPlanes = 1;







|







 







|







363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
....
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478

static const Tk_GeomMgr wmMgrType = {
    "wm",			/* name */
    TopLevelReqProc,		/* requestProc */
    NULL,			/* lostSlaveProc */
};

typedef struct {
    HPALETTE systemPalette;	/* System palette; refers to the currently
				 * installed foreground logical palette. */
    TkWindow *createWindow;	/* Window that is being constructed. This
				 * value is set immediately before a call to
				 * CreateWindowEx, and is used by SetLimits.
				 * This is a gross hack needed to work around
				 * Windows brain damage where it sends the
................................................................................
	 * converts them as required. Initialise icon info structure.
	 */

	ZeroMemory(&iconInfo, sizeof(iconInfo));
	iconInfo.fIcon = TRUE;

	/*
	 * Create device-independent color bitmap.
	 */

	ZeroMemory(&bmInfo, sizeof bmInfo);
	bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	bmInfo.bmiHeader.biWidth = width;
	bmInfo.bmiHeader.biHeight = -height;
	bmInfo.bmiHeader.biPlanes = 1;

Changes to jni/sdl2tk/win/tkWinX.c.

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

/*
 * Thread local storage. Notice that now each thread must have its own
 * TkDisplay structure, since this structure contains most of the thread-
 * specific date for threads.
 */

typedef struct ThreadSpecificData {
    TkDisplay *winDisplay;	/* TkDisplay structure that represents Windows
				 * screen. */
    int updatingClipboard;	/* If 1, we are updating the clipboard. */
    int surrogateBuffer;	/* Buffer for first of surrogate pair. */
    DWORD vWheelTickPrev;	/* For high resolution wheels (vertical). */
    DWORD hWheelTickPrev;	/* For high resolution wheels (horizontal). */
    short vWheelAcc;		/* For high resolution wheels (vertical). */







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

/*
 * Thread local storage. Notice that now each thread must have its own
 * TkDisplay structure, since this structure contains most of the thread-
 * specific date for threads.
 */

typedef struct {
    TkDisplay *winDisplay;	/* TkDisplay structure that represents Windows
				 * screen. */
    int updatingClipboard;	/* If 1, we are updating the clipboard. */
    int surrogateBuffer;	/* Buffer for first of surrogate pair. */
    DWORD vWheelTickPrev;	/* For high resolution wheels (vertical). */
    DWORD hWheelTickPrev;	/* For high resolution wheels (horizontal). */
    short vWheelAcc;		/* For high resolution wheels (vertical). */

Changes to jni/sdl2tk/xlib/xgc.c.

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
    XGCValues *values)
{
    GC gp;

    /*
     * In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars
     * are defined, which is invisible from the outside. The list is assumed
     * to end with a 0-char, so this must be set explicitely during
     * initialization.
     */

#define MAX_DASH_LIST_SIZE 10

    gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
    if (!gp) {
................................................................................
 *	uses of TkSetRegion are currently in DisplayFrame and in
 *	ImgPhotoDisplay, which use the GC immediately.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	Allocates or dealloates a TkpClipMask.
 *
 *----------------------------------------------------------------------
 */

void
TkSetRegion(
    Display *display,







|







 







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
    XGCValues *values)
{
    GC gp;

    /*
     * In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars
     * are defined, which is invisible from the outside. The list is assumed
     * to end with a 0-char, so this must be set explicitly during
     * initialization.
     */

#define MAX_DASH_LIST_SIZE 10

    gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
    if (!gp) {
................................................................................
 *	uses of TkSetRegion are currently in DisplayFrame and in
 *	ImgPhotoDisplay, which use the GC immediately.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	Allocates or deallocates a TkpClipMask.
 *
 *----------------------------------------------------------------------
 */

void
TkSetRegion(
    Display *display,