Tk Source Code

Check-in [e74e9b0e]
Login

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

Overview
Comment:merge trunk
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jn-web-colors
Files: files | file ages | folders
SHA1: e74e9b0e03ede7c147af3686a3952dc524a4a3bd
User & Date: jan.nijtmans 2012-04-29 08:22:32
Context
2012-05-05
16:27
merge trunk check-in: e8af2579 user: jan.nijtmans tags: jn-web-colors
2012-04-29
08:22
merge trunk check-in: e74e9b0e user: jan.nijtmans tags: jn-web-colors
07:37
[Bug 533519]: Window placement with multiple screens check-in: 49d4d5d6 user: jan.nijtmans tags: trunk
2012-04-12
21:04
merge trunk check-in: 5b94833c user: jan.nijtmans tags: jn-web-colors
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.
















































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23















































2012-04-07  Jan Nijtmans  <[email protected]>

	* generic/tkBind.c: [Bug 3176239] control-MouseWheel causes segv

2012-03-30  Jan Nijtmans  <[email protected]>

	* unix/tcl.m4:        [Bug 3511806] Compiler checks too early
	* unix/configure.in:  This change allows to build the cygwin
	* unix/configure      and mingw32 ports of Tcl/Tk to build
	* win/tcl.m4:         out-of-the-box using a native or cross-
	* win/configure.in:   compiler.
	* win/configure

2012-03-21  Jan Nijtmans  <[email protected]>

	* generic/tkColor.c:  [Bug 2809525] Abort on overlong color name.
	* unix/tkUnixColor.c:

2012-03-18  Jan Nijtmans  <[email protected]>

	* xlib/xcolors.c:   [RFE 3503317]: XParseColor speedup
	* xlib/rgb.txt:     List of all colors accepted by Tk in Xorg format
	* tests/color.test: Added test case for all colors in rgb.txt
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|



|








|







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
2012-04-29  Jan Nijtmans  <[email protected]>

	* library/tk.tcl:    [Bug 3508771]: Window placement with multiple screens
	* generic/tkBind.c:
	* generic/tkFocus.c:
	* generic/tkMenuDraw.c:
	* generic/tkWinWm.c:

2012-04-26  Donal K. Fellows  <[email protected]>

	* generic/tkStubInit.c (Tk_GetHINSTANCE): Ensure that this is defined
	for OSX.

2012-04-26  Jan Nijtmans  <[email protected]>

	* generic/tk.decls:      [Bug 3508771]: Implement TkClipBox, Tk*Region and
	* generic/tkInt.decls:   Tk_GetHINSTANCE for Cygwin
	* generic/tkPlatDecls.h:
	* generic/tkintDecls.h:
	* generic/tkStubInit.c:

2012-04-22  Donal K. Fellows  <[email protected]>

	* generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the
	%k, %K and %N substitutions use dummy tokens with <MouseWheel> events
	and that the %D subsitution is a dummy with <Key>/<KeyRelease>. This
	was causing significant indigestion (and a read of goodness knows what
	memory) to Tkinter/Python because of the way they map events between
	languages.

2012-04-20  Donal K. Fellows  <[email protected]>

	* generic/tkWindow.c (commands): Ensure that all descriptions of
	commands created by Tk are correct.

2012-04-20  Jan Nijtmans  <[email protected]>

	* generic/tk.tcl: Use vroot size in stead of screen size for clipping
	window coordinates in ::tk::PlaceWindow.
	* generic/dialog.tcl: Use ::tk::PlaceWindow in dialog.tcl, instead of
	dumplicating the code there. (harmless part of [Bug 533519])

2012-04-13  Jan Nijtmans  <[email protected]>

	* win/rules.vc: [Bug 3517448]: TclKit build fails (unresolved
	__strtoi64)

2012-04-07  Jan Nijtmans  <[email protected]>

	* generic/tkBind.c: [Bug 3176239]: control-MouseWheel causes segv

2012-03-30  Jan Nijtmans  <[email protected]>

	* unix/tcl.m4:        [Bug 3511806]: Compiler checks too early
	* unix/configure.in:  This change allows to build the cygwin
	* unix/configure      and mingw32 ports of Tcl/Tk to build
	* win/tcl.m4:         out-of-the-box using a native or cross-
	* win/configure.in:   compiler.
	* win/configure

2012-03-21  Jan Nijtmans  <[email protected]>

	* generic/tkColor.c:  [Bug 2809525]: Abort on overlong color name.
	* unix/tkUnixColor.c:

2012-03-18  Jan Nijtmans  <[email protected]>

	* xlib/xcolors.c:   [RFE 3503317]: XParseColor speedup
	* xlib/rgb.txt:     List of all colors accepted by Tk in Xorg format
	* tests/color.test: Added test case for all colors in rgb.txt

Changes to generic/tk.decls.

1083
1084
1085
1086
1087
1088
1089

1090




















1091
1092
1093
1094
1095
1096
1097
# Define the platform specific public Tk interface.  These functions are
# only available on the designated platform.

interface tkPlat

################################
# Unix specific functions

#   (none)





















################################
# Windows specific functions

declare 0 win {
    Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd)
}







>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
# Define the platform specific public Tk interface.  These functions are
# only available on the designated platform.

interface tkPlat

################################
# Unix specific functions
#

declare 0 unix {
    Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd)
}
declare 1 unix {
    void *Tk_GetHINSTANCE(void)
}
declare 2 unix {
    void *Tk_GetHWND(Window window)
}
declare 3 unix {
    Tk_Window Tk_HWNDToWindow(void *hwnd)
}
declare 4 unix {
    void Tk_PointerEvent(void *hwnd, int x, int y)
}
declare 5 unix {
    int Tk_TranslateWinEvent(void *hwnd,
	    unsigned int message, int wParam, int lParam, int *result)
}


################################
# Windows specific functions

declare 0 win {
    Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd)
}

Changes to generic/tkBind.c.

2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
		TkpPrintWindowId(numStorage, eventPtr->xmaprequest.window);
	    } else {
		TkpPrintWindowId(numStorage, eventPtr->xany.window);
	    }
	    string = numStorage;
	    goto doString;
	case 'k':
	    if (flags & KEY) {
		number = eventPtr->xkey.keycode;
		goto doNumber;
	    }
	    goto doString;
	case 'm':
	    if (flags & CROSSING) {
		number = eventPtr->xcrossing.mode;







|







2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
		TkpPrintWindowId(numStorage, eventPtr->xmaprequest.window);
	    } else {
		TkpPrintWindowId(numStorage, eventPtr->xany.window);
	    }
	    string = numStorage;
	    goto doString;
	case 'k':
	    if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
		number = eventPtr->xkey.keycode;
		goto doNumber;
	    }
	    goto doString;
	case 'm':
	    if (flags & CROSSING) {
		number = eventPtr->xcrossing.mode;
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
	    }
	    goto doNumber;
	case 'D':
	    /*
	     * This is used only by the MouseWheel event.
	     */

	    if (flags & KEY) {
		number = eventPtr->xkey.keycode;
		goto doNumber;
	    }
	    goto doString;
	case 'E':
	    number = (int) eventPtr->xany.send_event;
	    goto doNumber;
	case 'K':
	    if (flags & KEY) {
		const char *name = TkKeysymToString(keySym);

		if (name != NULL) {
		    string = name;
		}
	    }
	    goto doString;
	case 'N':
	    if (flags & KEY) {
		number = (int) keySym;
		goto doNumber;
	    }
	    goto doString;
	case 'P':
	    if (flags & PROP) {
		string = Tk_GetAtomName((Tk_Window) winPtr,







|








|








|







2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
	    }
	    goto doNumber;
	case 'D':
	    /*
	     * This is used only by the MouseWheel event.
	     */

	    if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) {
		number = eventPtr->xkey.keycode;
		goto doNumber;
	    }
	    goto doString;
	case 'E':
	    number = (int) eventPtr->xany.send_event;
	    goto doNumber;
	case 'K':
	    if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
		const char *name = TkKeysymToString(keySym);

		if (name != NULL) {
		    string = name;
		}
	    }
	    goto doString;
	case 'N':
	    if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) {
		number = (int) keySym;
		goto doNumber;
	    }
	    goto doString;
	case 'P':
	    if (flags & PROP) {
		string = Tk_GetAtomName((Tk_Window) winPtr,
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
	    } else {
		string = "??";
	    }
	    goto doString;
	}
	case 'X':
	    if (flags & KEY_BUTTON_MOTION_CROSSING) {
		Tk_Window tkwin;
		int x, y;
		int width, height;

		number = eventPtr->xkey.x_root;
		tkwin = Tk_IdToWindow(eventPtr->xany.display,
			eventPtr->xany.window);
		if (tkwin != NULL) {
		    Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
		    number -= x;
		}
		goto doNumber;
	    }
	    goto doString;
	case 'Y':
	    if (flags & KEY_BUTTON_MOTION_CROSSING) {
		Tk_Window tkwin;
		int x, y;
		int width, height;

		number = eventPtr->xkey.y_root;
		tkwin = Tk_IdToWindow(eventPtr->xany.display,
			eventPtr->xany.window);
		if (tkwin != NULL) {
		    Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height);
		    number -= y;
		}
		goto doNumber;
	    }
	    goto doString;
	default:
	    numStorage[0] = before[1];
	    numStorage[1] = '\0';
	    string = numStorage;







<
<
<


|

<
<
<
<





<
<
<


|

<
<
<
<







2222
2223
2224
2225
2226
2227
2228



2229
2230
2231
2232




2233
2234
2235
2236
2237



2238
2239
2240
2241




2242
2243
2244
2245
2246
2247
2248
	    } else {
		string = "??";
	    }
	    goto doString;
	}
	case 'X':
	    if (flags & KEY_BUTTON_MOTION_CROSSING) {




		number = eventPtr->xkey.x_root;
		Tk_IdToWindow(eventPtr->xany.display,
			eventPtr->xany.window);




		goto doNumber;
	    }
	    goto doString;
	case 'Y':
	    if (flags & KEY_BUTTON_MOTION_CROSSING) {




		number = eventPtr->xkey.y_root;
		Tk_IdToWindow(eventPtr->xany.display,
			eventPtr->xany.window);




		goto doNumber;
	    }
	    goto doString;
	default:
	    numStorage[0] = before[1];
	    numStorage[1] = '\0';
	    string = numStorage;

Changes to generic/tkFocus.c.

711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
    TkWindow *winPtr,		/* Window that selects an application and a
				 * display. */
    XEvent *eventPtr)		/* X event to redirect (should be KeyPress or
				 * KeyRelease). */
{
    DisplayFocusInfo *displayFocusPtr;
    TkWindow *focusWinPtr;
    int focusX, focusY, vRootX, vRootY, vRootWidth, vRootHeight;

    displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
    focusWinPtr = displayFocusPtr->focusWinPtr;

    /*
     * The code below is a debugging aid to make sure that dispPtr->focusPtr
     * is kept properly in sync with the "truth", which is the value in







|







711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
    TkWindow *winPtr,		/* Window that selects an application and a
				 * display. */
    XEvent *eventPtr)		/* X event to redirect (should be KeyPress or
				 * KeyRelease). */
{
    DisplayFocusInfo *displayFocusPtr;
    TkWindow *focusWinPtr;
    int focusX, focusY;

    displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr);
    focusWinPtr = displayFocusPtr->focusWinPtr;

    /*
     * The code below is a debugging aid to make sure that dispPtr->focusPtr
     * is kept properly in sync with the "truth", which is the value in
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
	 */

	if ((focusWinPtr->display != winPtr->display)
		|| (focusWinPtr->screenNum != winPtr->screenNum)) {
	    eventPtr->xkey.x = -1;
	    eventPtr->xkey.y = -1;
	} else {
	    Tk_GetVRootGeometry((Tk_Window) focusWinPtr, &vRootX, &vRootY,
		    &vRootWidth, &vRootHeight);
	    Tk_GetRootCoords((Tk_Window) focusWinPtr, &focusX, &focusY);
	    eventPtr->xkey.x = eventPtr->xkey.x_root - vRootX - focusX;
	    eventPtr->xkey.y = eventPtr->xkey.y_root - vRootY - focusY;
	}
	eventPtr->xkey.window = focusWinPtr->window;
	return focusWinPtr;
    }

    /*
     * The event doesn't belong to us. Perhaps, due to embedding, it really







<
<

|
|







744
745
746
747
748
749
750


751
752
753
754
755
756
757
758
759
760
	 */

	if ((focusWinPtr->display != winPtr->display)
		|| (focusWinPtr->screenNum != winPtr->screenNum)) {
	    eventPtr->xkey.x = -1;
	    eventPtr->xkey.y = -1;
	} else {


	    Tk_GetRootCoords((Tk_Window) focusWinPtr, &focusX, &focusY);
	    eventPtr->xkey.x = eventPtr->xkey.x_root - focusX;
	    eventPtr->xkey.y = eventPtr->xkey.y_root - focusY;
	}
	eventPtr->xkey.window = focusWinPtr->window;
	return focusWinPtr;
    }

    /*
     * The event doesn't belong to us. Perhaps, due to embedding, it really

Changes to generic/tkInt.decls.

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
declare 111 {
    Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin,
	    const char *dbName, const char *className)
}
declare 112 {
    void TkpMenuThreadInit(void)
}
declare 113 {aqua win} {
    void TkClipBox(TkRegion rgn, XRectangle *rect_return)
}
declare 114 {aqua win} {
    TkRegion TkCreateRegion(void)
}
declare 115 {aqua win} {
    void TkDestroyRegion(TkRegion rgn)
}
declare 116 {aqua win} {
    void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
declare 117 {aqua win} {
    int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
	    unsigned int height)
}
declare 118 {aqua win} {
    void TkSetRegion(Display *display, GC gc, TkRegion rgn)
}
declare 119 {aqua win} {
    void TkUnionRectWithRegion(XRectangle *rect,
	    TkRegion src, TkRegion dr_return)
}
declare 121 aqua {
    Pixmap TkpCreateNativeBitmap(Display *display, const void *source)
}
declare 122 aqua {







|


|


|


|


|



|


|







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
declare 111 {
    Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin,
	    const char *dbName, const char *className)
}
declare 112 {
    void TkpMenuThreadInit(void)
}
declare 113 {
    void TkClipBox(TkRegion rgn, XRectangle *rect_return)
}
declare 114 {
    TkRegion TkCreateRegion(void)
}
declare 115 {
    void TkDestroyRegion(TkRegion rgn)
}
declare 116 {
    void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
declare 117 {
    int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width,
	    unsigned int height)
}
declare 118 {
    void TkSetRegion(Display *display, GC gc, TkRegion rgn)
}
declare 119 {
    void TkUnionRectWithRegion(XRectangle *rect,
	    TkRegion src, TkRegion dr_return)
}
declare 121 aqua {
    Pixmap TkpCreateNativeBitmap(Display *display, const void *source)
}
declare 122 aqua {
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
}
declare 143 {
    void TkClipCleanup(TkDisplay *dispPtr)
}
declare 144 {
    void TkGCCleanup(TkDisplay *dispPtr)
}
declare 145 {win aqua} {
    void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
declare 146 {
    void TkStylePkgInit(TkMainInfo *mainPtr)
}
declare 147 {
    void TkStylePkgFree(TkMainInfo *mainPtr)







|







459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
}
declare 143 {
    void TkClipCleanup(TkDisplay *dispPtr)
}
declare 144 {
    void TkGCCleanup(TkDisplay *dispPtr)
}
declare 145 {
    void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
declare 146 {
    void TkStylePkgInit(TkMainInfo *mainPtr)
}
declare 147 {
    void TkStylePkgFree(TkMainInfo *mainPtr)

Changes to generic/tkIntDecls.h.

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
/* 110 */
EXTERN void		TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
/* 111 */
EXTERN Tcl_Obj *	TkpGetSystemDefault(Tk_Window tkwin,
				const char *dbName, const char *className);
/* 112 */
EXTERN void		TkpMenuThreadInit(void);
#ifdef __WIN32__ /* WIN */
/* 113 */
EXTERN void		TkClipBox(TkRegion rgn, XRectangle *rect_return);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 113 */
EXTERN void		TkClipBox(TkRegion rgn, XRectangle *rect_return);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 114 */
EXTERN TkRegion		TkCreateRegion(void);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 114 */
EXTERN TkRegion		TkCreateRegion(void);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 115 */
EXTERN void		TkDestroyRegion(TkRegion rgn);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 115 */
EXTERN void		TkDestroyRegion(TkRegion rgn);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 116 */
EXTERN void		TkIntersectRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 116 */
EXTERN void		TkIntersectRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 117 */
EXTERN int		TkRectInRegion(TkRegion rgn, int x, int y,
				unsigned int width, unsigned int height);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 117 */
EXTERN int		TkRectInRegion(TkRegion rgn, int x, int y,
				unsigned int width, unsigned int height);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 118 */
EXTERN void		TkSetRegion(Display *display, GC gc, TkRegion rgn);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 118 */
EXTERN void		TkSetRegion(Display *display, GC gc, TkRegion rgn);
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
/* 119 */
EXTERN void		TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
				TkRegion dr_return);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 119 */
EXTERN void		TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
				TkRegion dr_return);
#endif /* AQUA */
/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
/* 121 */
EXTERN Pixmap		TkpCreateNativeBitmap(Display *display,
				const void *source);
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */







<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<
<



<
<
<
<
<
<
<



<
<
<
<
<
<
<


<
<
<
<
<
<



<
<
<
<
<
<







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
/* 110 */
EXTERN void		TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont);
/* 111 */
EXTERN Tcl_Obj *	TkpGetSystemDefault(Tk_Window tkwin,
				const char *dbName, const char *className);
/* 112 */
EXTERN void		TkpMenuThreadInit(void);

/* 113 */
EXTERN void		TkClipBox(TkRegion rgn, XRectangle *rect_return);






/* 114 */
EXTERN TkRegion		TkCreateRegion(void);






/* 115 */
EXTERN void		TkDestroyRegion(TkRegion rgn);






/* 116 */
EXTERN void		TkIntersectRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);







/* 117 */
EXTERN int		TkRectInRegion(TkRegion rgn, int x, int y,
				unsigned int width, unsigned int height);







/* 118 */
EXTERN void		TkSetRegion(Display *display, GC gc, TkRegion rgn);






/* 119 */
EXTERN void		TkUnionRectWithRegion(XRectangle *rect, TkRegion src,
				TkRegion dr_return);






/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
/* 121 */
EXTERN Pixmap		TkpCreateNativeBitmap(Display *display,
				const void *source);
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
EXTERN TkWindow **	TkWmStackorderToplevel(TkWindow *parentPtr);
/* 142 */
EXTERN void		TkFocusFree(TkMainInfo *mainPtr);
/* 143 */
EXTERN void		TkClipCleanup(TkDisplay *dispPtr);
/* 144 */
EXTERN void		TkGCCleanup(TkDisplay *dispPtr);
#ifdef __WIN32__ /* WIN */
/* 145 */
EXTERN void		TkSubtractRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 145 */
EXTERN void		TkSubtractRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);
#endif /* AQUA */
/* 146 */
EXTERN void		TkStylePkgInit(TkMainInfo *mainPtr);
/* 147 */
EXTERN void		TkStylePkgFree(TkMainInfo *mainPtr);
/* 148 */
EXTERN Tk_Window	TkToplevelWindowForCommand(Tcl_Interp *interp,
				const char *cmdName);







<



<
<
<
<
<
<







391
392
393
394
395
396
397

398
399
400






401
402
403
404
405
406
407
EXTERN TkWindow **	TkWmStackorderToplevel(TkWindow *parentPtr);
/* 142 */
EXTERN void		TkFocusFree(TkMainInfo *mainPtr);
/* 143 */
EXTERN void		TkClipCleanup(TkDisplay *dispPtr);
/* 144 */
EXTERN void		TkGCCleanup(TkDisplay *dispPtr);

/* 145 */
EXTERN void		TkSubtractRegion(TkRegion sra, TkRegion srcb,
				TkRegion dr_return);






/* 146 */
EXTERN void		TkStylePkgInit(TkMainInfo *mainPtr);
/* 147 */
EXTERN void		TkStylePkgFree(TkMainInfo *mainPtr);
/* 148 */
EXTERN Tk_Window	TkToplevelWindowForCommand(Tcl_Interp *interp,
				const char *cmdName);
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
    TkDisplay * (*tkGetDisplayList) (void); /* 106 */
    TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */
    int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */
    CONST86 char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
    void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
    Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */
    void (*tkpMenuThreadInit) (void); /* 112 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved113)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved113)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved114)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkRegion (*tkCreateRegion) (void); /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved114)(void); /* Dummy entry for stubs table backwards compatibility */
    TkRegion (*tkCreateRegion) (void); /* 114 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved115)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkDestroyRegion) (TkRegion rgn); /* 115 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved115)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkDestroyRegion) (TkRegion rgn); /* 115 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved116)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved116)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved117)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved117)(void); /* Dummy entry for stubs table backwards compatibility */
    int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved118)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved118)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved119)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved119)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */
#endif /* AQUA */
    void (*reserved120)(void);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved121)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*reserved121)(void);
#endif /* WIN */







<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<







660
661
662
663
664
665
666




667









668









669









670









671









672









673





674
675
676
677
678
679
680
    TkDisplay * (*tkGetDisplayList) (void); /* 106 */
    TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */
    int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */
    CONST86 char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */
    void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */
    Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */
    void (*tkpMenuThreadInit) (void); /* 112 */




    void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */









    TkRegion (*tkCreateRegion) (void); /* 114 */









    void (*tkDestroyRegion) (TkRegion rgn); /* 115 */









    void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */









    int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */









    void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */









    void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */





    void (*reserved120)(void);
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved121)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*reserved121)(void);
#endif /* WIN */
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
    KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */
    void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */
    TkRegion (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */
    TkWindow ** (*tkWmStackorderToplevel) (TkWindow *parentPtr); /* 141 */
    void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */
    void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */
    void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    void (*reserved145)(void);
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*reserved145)(void); /* Dummy entry for stubs table backwards compatibility */
    void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */
#endif /* AQUA */
    void (*tkStylePkgInit) (TkMainInfo *mainPtr); /* 146 */
    void (*tkStylePkgFree) (TkMainInfo *mainPtr); /* 147 */
    Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, const char *cmdName); /* 148 */
    const Tk_OptionSpec * (*tkGetOptionSpec) (const char *name, Tk_OptionTable optionTable); /* 149 */
    int (*tkMakeRawCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 150 */
    void (*tkMakeRawCurvePostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 151 */
    void (*tkpDrawFrame) (Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); /* 152 */







<
<
<
<

<
<
<
<
<







719
720
721
722
723
724
725




726





727
728
729
730
731
732
733
    KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */
    void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */
    TkRegion (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */
    TkWindow ** (*tkWmStackorderToplevel) (TkWindow *parentPtr); /* 141 */
    void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */
    void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */
    void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */




    void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */





    void (*tkStylePkgInit) (TkMainInfo *mainPtr); /* 146 */
    void (*tkStylePkgFree) (TkMainInfo *mainPtr); /* 147 */
    Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, const char *cmdName); /* 148 */
    const Tk_OptionSpec * (*tkGetOptionSpec) (const char *name, Tk_OptionTable optionTable); /* 149 */
    int (*tkMakeRawCurve) (Tk_Canvas canvas, double *pointPtr, int numPoints, int numSteps, XPoint xPoints[], double dblPoints[]); /* 150 */
    void (*tkMakeRawCurvePostscript) (Tcl_Interp *interp, Tk_Canvas canvas, double *pointPtr, int numPoints); /* 151 */
    void (*tkpDrawFrame) (Tk_Window tkwin, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); /* 152 */
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
	(tkIntStubsPtr->tkpGetString) /* 109 */
#define TkpGetSubFonts \
	(tkIntStubsPtr->tkpGetSubFonts) /* 110 */
#define TkpGetSystemDefault \
	(tkIntStubsPtr->tkpGetSystemDefault) /* 111 */
#define TkpMenuThreadInit \
	(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */
#ifdef __WIN32__ /* WIN */
#define TkClipBox \
	(tkIntStubsPtr->tkClipBox) /* 113 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkClipBox \
	(tkIntStubsPtr->tkClipBox) /* 113 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkCreateRegion \
	(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkCreateRegion \
	(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkDestroyRegion \
	(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkDestroyRegion \
	(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkIntersectRegion \
	(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkIntersectRegion \
	(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkRectInRegion \
	(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkRectInRegion \
	(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkSetRegion \
	(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkSetRegion \
	(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif /* AQUA */
#ifdef __WIN32__ /* WIN */
#define TkUnionRectWithRegion \
	(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkUnionRectWithRegion \
	(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif /* AQUA */
/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
#define TkpCreateNativeBitmap \
	(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */
#define TkpDefineNativeBitmaps \







<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<
<


<
<
<
<
<







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
	(tkIntStubsPtr->tkpGetString) /* 109 */
#define TkpGetSubFonts \
	(tkIntStubsPtr->tkpGetSubFonts) /* 110 */
#define TkpGetSystemDefault \
	(tkIntStubsPtr->tkpGetSystemDefault) /* 111 */
#define TkpMenuThreadInit \
	(tkIntStubsPtr->tkpMenuThreadInit) /* 112 */

#define TkClipBox \
	(tkIntStubsPtr->tkClipBox) /* 113 */






#define TkCreateRegion \
	(tkIntStubsPtr->tkCreateRegion) /* 114 */






#define TkDestroyRegion \
	(tkIntStubsPtr->tkDestroyRegion) /* 115 */






#define TkIntersectRegion \
	(tkIntStubsPtr->tkIntersectRegion) /* 116 */






#define TkRectInRegion \
	(tkIntStubsPtr->tkRectInRegion) /* 117 */






#define TkSetRegion \
	(tkIntStubsPtr->tkSetRegion) /* 118 */






#define TkUnionRectWithRegion \
	(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */





/* Slot 120 is reserved */
#ifdef MAC_OSX_TK /* AQUA */
#define TkpCreateNativeBitmap \
	(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
#endif /* AQUA */
#ifdef MAC_OSX_TK /* AQUA */
#define TkpDefineNativeBitmaps \
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
	(tkIntStubsPtr->tkWmStackorderToplevel) /* 141 */
#define TkFocusFree \
	(tkIntStubsPtr->tkFocusFree) /* 142 */
#define TkClipCleanup \
	(tkIntStubsPtr->tkClipCleanup) /* 143 */
#define TkGCCleanup \
	(tkIntStubsPtr->tkGCCleanup) /* 144 */
#ifdef __WIN32__ /* WIN */
#define TkSubtractRegion \
	(tkIntStubsPtr->tkSubtractRegion) /* 145 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define TkSubtractRegion \
	(tkIntStubsPtr->tkSubtractRegion) /* 145 */
#endif /* AQUA */
#define TkStylePkgInit \
	(tkIntStubsPtr->tkStylePkgInit) /* 146 */
#define TkStylePkgFree \
	(tkIntStubsPtr->tkStylePkgFree) /* 147 */
#define TkToplevelWindowForCommand \
	(tkIntStubsPtr->tkToplevelWindowForCommand) /* 148 */
#define TkGetOptionSpec \







<


<
<
<
<
<







1054
1055
1056
1057
1058
1059
1060

1061
1062





1063
1064
1065
1066
1067
1068
1069
	(tkIntStubsPtr->tkWmStackorderToplevel) /* 141 */
#define TkFocusFree \
	(tkIntStubsPtr->tkFocusFree) /* 142 */
#define TkClipCleanup \
	(tkIntStubsPtr->tkClipCleanup) /* 143 */
#define TkGCCleanup \
	(tkIntStubsPtr->tkGCCleanup) /* 144 */

#define TkSubtractRegion \
	(tkIntStubsPtr->tkSubtractRegion) /* 145 */





#define TkStylePkgInit \
	(tkIntStubsPtr->tkStylePkgInit) /* 146 */
#define TkStylePkgFree \
	(tkIntStubsPtr->tkStylePkgFree) /* 147 */
#define TkToplevelWindowForCommand \
	(tkIntStubsPtr->tkToplevelWindowForCommand) /* 148 */
#define TkGetOptionSpec \
1313
1314
1315
1316
1317
1318
1319




























1320
1321
#endif /* defined(USE_TK_STUBS) */

/* !END!: Do not edit above this line. */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT





























#endif /* _TKINTDECLS */








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


1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
#endif /* defined(USE_TK_STUBS) */

/* !END!: Do not edit above this line. */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT

/*
 * On X11, these macros are just wrappers for the equivalent X Region calls.
 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */

#undef TkClipBox
#undef TkCreateRegion
#undef TkDestroyRegion
#undef TkIntersectRegion
#undef TkRectInRegion
#undef TkSetRegion
#undef TkSubtractRegion
#undef TkUnionRectWithRegion

#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
#define TkCreateRegion() (TkRegion) XCreateRegion()
#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
	(Region) b, (Region) r)
#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
	(Region) b, (Region) r)
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
	(Region) src, (Region) ret)

#endif /* UNIX */

#endif /* _TKINTDECLS */

Changes to generic/tkMenuDraw.c.

840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
TkPostTearoffMenu(
    Tcl_Interp *interp,		/* The interpreter of the menu */
    TkMenu *menuPtr,		/* The menu we are posting */
    int x, int y)		/* The root X,Y coordinates where we are
				 * posting */
{
    int vRootX, vRootY, vRootWidth, vRootHeight;
    int tmp, result;

    TkActivateMenuEntry(menuPtr, -1);
    TkRecomputeMenu(menuPtr);
    result = TkPostCommand(menuPtr);
    if (result != TCL_OK) {
    	return result;
    }







|







840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
TkPostTearoffMenu(
    Tcl_Interp *interp,		/* The interpreter of the menu */
    TkMenu *menuPtr,		/* The menu we are posting */
    int x, int y)		/* The root X,Y coordinates where we are
				 * posting */
{
    int vRootX, vRootY, vRootWidth, vRootHeight;
    int result;

    TkActivateMenuEntry(menuPtr, -1);
    TkRecomputeMenu(menuPtr);
    result = TkPostCommand(menuPtr);
    if (result != TCL_OK) {
    	return result;
    }
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
     *    (if any) to the real root. Can't get the virtual root from the menu
     *    itself (it will never be seen by the wm) so use its parent instead
     *    (it would be better to have an an option that names a window to use
     *    for this...).
     * 2. The menu may not have been mapped yet, so its current size might be
     *    the default 1x1. To compute how much space it needs, use its
     *    requested size, not its actual size.
     *
     * Note that this code assumes square screen regions and all positive
     * coordinates. This does not work on a Mac with multiple monitors. But
     * then again, Tk has other problems with this.
     */

    Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY,
	&vRootWidth, &vRootHeight);
    x += vRootX;
    y += vRootY;
    tmp = WidthOfScreen(Tk_Screen(menuPtr->tkwin))
	- Tk_ReqWidth(menuPtr->tkwin);
    if (x > tmp) {
	x = tmp;
    }
    if (x < 0) {
	x = 0;
    }
    tmp = HeightOfScreen(Tk_Screen(menuPtr->tkwin))
	- Tk_ReqHeight(menuPtr->tkwin);
    if (y > tmp) {
	y = tmp;
    }
    if (y < 0) {
	y = 0;
    }
    Tk_MoveToplevelWindow(menuPtr->tkwin, x, y);
    if (!Tk_IsMapped(menuPtr->tkwin)) {
	Tk_MapWindow(menuPtr->tkwin);
    }
    TkWmRestackToplevel((TkWindow *) menuPtr->tkwin, Above, NULL);
    return TCL_OK;







<
<
<
<




<
<
<
<
|
|

|
|

<
<
|
|

|
|







873
874
875
876
877
878
879




880
881
882
883




884
885
886
887
888
889


890
891
892
893
894
895
896
897
898
899
900
901
     *    (if any) to the real root. Can't get the virtual root from the menu
     *    itself (it will never be seen by the wm) so use its parent instead
     *    (it would be better to have an an option that names a window to use
     *    for this...).
     * 2. The menu may not have been mapped yet, so its current size might be
     *    the default 1x1. To compute how much space it needs, use its
     *    requested size, not its actual size.




     */

    Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY,
	&vRootWidth, &vRootHeight);




    if (x > vRootX + vRootWidth) {
	x = vRootX + vRootWidth;
    }
    if (x < vRootX) {
	x = vRootX;
    }


    if (y > vRootY + vRootHeight) {
	y = vRootY + vRootHeight;
    }
    if (y < vRootY) {
	y = vRootY;
    }
    Tk_MoveToplevelWindow(menuPtr->tkwin, x, y);
    if (!Tk_IsMapped(menuPtr->tkwin)) {
	Tk_MapWindow(menuPtr->tkwin);
    }
    TkWmRestackToplevel((TkWindow *) menuPtr->tkwin, Above, NULL);
    return TCL_OK;

Changes to generic/tkPlatDecls.h.

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

/* !BEGIN!: Do not edit below this line. */

/*
 * Exported function declarations:
 */

















#ifdef __WIN32__ /* WIN */
/* 0 */
EXTERN Window		Tk_AttachHWND(Tk_Window tkwin, HWND hwnd);
/* 1 */
EXTERN HINSTANCE	Tk_GetHINSTANCE(void);
/* 2 */
EXTERN HWND		Tk_GetHWND(Window window);
/* 3 */
EXTERN Tk_Window	Tk_HWNDToWindow(HWND hwnd);
/* 4 */
EXTERN void		Tk_PointerEvent(HWND hwnd, int x, int y);
/* 5 */
EXTERN int		Tk_TranslateWinEvent(HWND hwnd, UINT message,
				WPARAM wParam, LPARAM lParam,
				LRESULT *result);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 0 */
EXTERN void		Tk_MacOSXSetEmbedHandler(
				Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
				Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr,
				Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
				Tk_MacOSXEmbedGetClipProc *getClipProc,
				Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc);
/* 1 */
EXTERN void		Tk_MacOSXTurnOffMenus(void);
/* 2 */
EXTERN void		Tk_MacOSXTkOwnsCursor(int tkOwnsIt);
/* 3 */
EXTERN void		TkMacOSXInitMenus(Tcl_Interp *interp);
/* 4 */
EXTERN void		TkMacOSXInitAppleEvents(Tcl_Interp *interp);
/* 5 */
EXTERN void		TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y,

				int width, int height, int flags);
/* 6 */
EXTERN void		TkMacOSXInvalClipRgns(Tk_Window tkwin);
/* 7 */
EXTERN void *		TkMacOSXGetDrawablePort(Drawable drawable);
/* 8 */
EXTERN void *		TkMacOSXGetRootControl(Drawable drawable);
/* 9 */
EXTERN void		Tk_MacOSXSetupTkNotifier(void);
/* 10 */
EXTERN int		Tk_MacOSXIsAppInFront(void);
#endif /* AQUA */

typedef struct TkPlatStubs {
    int magic;
    const struct TkPlatStubHooks *hooks;









#ifdef __WIN32__ /* WIN */
    Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */
    HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */
    HWND (*tk_GetHWND) (Window window); /* 2 */
    Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */
    void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */
    int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    void (*tk_MacOSXSetEmbedHandler) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 0 */
    void (*tk_MacOSXTurnOffMenus) (void); /* 1 */
    void (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */
    void (*tkMacOSXInitMenus) (Tcl_Interp *interp); /* 3 */
    void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */
    void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */
    void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
    void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
    void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
    void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
    int (*tk_MacOSXIsAppInFront) (void); /* 10 */
#endif /* AQUA */
} TkPlatStubs;







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


















|
<
<
<
<
<

|

|

|

|

|
>
|
















>
>
>
>
>
>
>
>









|
|
|
|
|
|







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

/* !BEGIN!: Do not edit below this line. */

/*
 * Exported function declarations:
 */

#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
/* 0 */
EXTERN Window		Tk_AttachHWND(Tk_Window tkwin, void *hwnd);
/* 1 */
EXTERN void *		Tk_GetHINSTANCE(void);
/* 2 */
EXTERN void *		Tk_GetHWND(Window window);
/* 3 */
EXTERN Tk_Window	Tk_HWNDToWindow(void *hwnd);
/* 4 */
EXTERN void		Tk_PointerEvent(void *hwnd, int x, int y);
/* 5 */
EXTERN int		Tk_TranslateWinEvent(void *hwnd,
				unsigned int message, int wParam, int lParam,
				int *result);
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
/* 0 */
EXTERN Window		Tk_AttachHWND(Tk_Window tkwin, HWND hwnd);
/* 1 */
EXTERN HINSTANCE	Tk_GetHINSTANCE(void);
/* 2 */
EXTERN HWND		Tk_GetHWND(Window window);
/* 3 */
EXTERN Tk_Window	Tk_HWNDToWindow(HWND hwnd);
/* 4 */
EXTERN void		Tk_PointerEvent(HWND hwnd, int x, int y);
/* 5 */
EXTERN int		Tk_TranslateWinEvent(HWND hwnd, UINT message,
				WPARAM wParam, LPARAM lParam,
				LRESULT *result);
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
/* 0 */
EXTERN Window		Tk_AttachHWND(Tk_Window tkwin, void *hwnd);





/* 1 */
EXTERN void *		Tk_GetHINSTANCE(void);
/* 2 */
EXTERN void *		Tk_GetHWND(Window window);
/* 3 */
EXTERN Tk_Window	Tk_HWNDToWindow(void *hwnd);
/* 4 */
EXTERN void		Tk_PointerEvent(void *hwnd, int x, int y);
/* 5 */
EXTERN int		Tk_TranslateWinEvent(void *hwnd,
				unsigned int message, int wParam, int lParam,
				int *result);
/* 6 */
EXTERN void		TkMacOSXInvalClipRgns(Tk_Window tkwin);
/* 7 */
EXTERN void *		TkMacOSXGetDrawablePort(Drawable drawable);
/* 8 */
EXTERN void *		TkMacOSXGetRootControl(Drawable drawable);
/* 9 */
EXTERN void		Tk_MacOSXSetupTkNotifier(void);
/* 10 */
EXTERN int		Tk_MacOSXIsAppInFront(void);
#endif /* AQUA */

typedef struct TkPlatStubs {
    int magic;
    const struct TkPlatStubHooks *hooks;

#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
    Window (*tk_AttachHWND) (Tk_Window tkwin, void *hwnd); /* 0 */
    void * (*tk_GetHINSTANCE) (void); /* 1 */
    void * (*tk_GetHWND) (Window window); /* 2 */
    Tk_Window (*tk_HWNDToWindow) (void *hwnd); /* 3 */
    void (*tk_PointerEvent) (void *hwnd, int x, int y); /* 4 */
    int (*tk_TranslateWinEvent) (void *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
    Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */
    HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */
    HWND (*tk_GetHWND) (Window window); /* 2 */
    Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */
    void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */
    int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    Window (*tk_AttachHWND) (Tk_Window tkwin, void *hwnd); /* 0 */
    void * (*tk_GetHINSTANCE) (void); /* 1 */
    void * (*tk_GetHWND) (Window window); /* 2 */
    Tk_Window (*tk_HWNDToWindow) (void *hwnd); /* 3 */
    void (*tk_PointerEvent) (void *hwnd, int x, int y); /* 4 */
    int (*tk_TranslateWinEvent) (void *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */
    void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */
    void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */
    void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */
    void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */
    int (*tk_MacOSXIsAppInFront) (void); /* 10 */
#endif /* AQUA */
} TkPlatStubs;
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

#if defined(USE_TK_STUBS)

/*
 * Inline function declarations:
 */















#ifdef __WIN32__ /* WIN */
#define Tk_AttachHWND \
	(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
#define Tk_GetHINSTANCE \
	(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
#define Tk_GetHWND \
	(tkPlatStubsPtr->tk_GetHWND) /* 2 */
#define Tk_HWNDToWindow \
	(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
#define Tk_PointerEvent \
	(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
#define Tk_TranslateWinEvent \
	(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define Tk_MacOSXSetEmbedHandler \
	(tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */
#define Tk_MacOSXTurnOffMenus \
	(tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */
#define Tk_MacOSXTkOwnsCursor \
	(tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */
#define TkMacOSXInitMenus \
	(tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */
#define TkMacOSXInitAppleEvents \
	(tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */
#define TkGenWMConfigureEvent \
	(tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */
#define TkMacOSXInvalClipRgns \
	(tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
#define TkMacOSXGetDrawablePort \
	(tkPlatStubsPtr->tkMacOSXGetDrawablePort) /* 7 */
#define TkMacOSXGetRootControl \
	(tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */
#define Tk_MacOSXSetupTkNotifier \







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















|
|
|
|
|
|
|
|
|
|
|
|







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

#if defined(USE_TK_STUBS)

/*
 * Inline function declarations:
 */

#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
#define Tk_AttachHWND \
	(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
#define Tk_GetHINSTANCE \
	(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
#define Tk_GetHWND \
	(tkPlatStubsPtr->tk_GetHWND) /* 2 */
#define Tk_HWNDToWindow \
	(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
#define Tk_PointerEvent \
	(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
#define Tk_TranslateWinEvent \
	(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
#define Tk_AttachHWND \
	(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
#define Tk_GetHINSTANCE \
	(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
#define Tk_GetHWND \
	(tkPlatStubsPtr->tk_GetHWND) /* 2 */
#define Tk_HWNDToWindow \
	(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
#define Tk_PointerEvent \
	(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
#define Tk_TranslateWinEvent \
	(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
#define Tk_AttachHWND \
	(tkPlatStubsPtr->tk_AttachHWND) /* 0 */
#define Tk_GetHINSTANCE \
	(tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */
#define Tk_GetHWND \
	(tkPlatStubsPtr->tk_GetHWND) /* 2 */
#define Tk_HWNDToWindow \
	(tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */
#define Tk_PointerEvent \
	(tkPlatStubsPtr->tk_PointerEvent) /* 4 */
#define Tk_TranslateWinEvent \
	(tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */
#define TkMacOSXInvalClipRgns \
	(tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
#define TkMacOSXGetDrawablePort \
	(tkPlatStubsPtr->tkMacOSXGetDrawablePort) /* 7 */
#define TkMacOSXGetRootControl \
	(tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */
#define Tk_MacOSXSetupTkNotifier \

Changes to generic/tkStubInit.c.

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

/*
 * WARNING: The contents of this file is automatically generated by the
 * tools/genStubs.tcl script. Any modifications to the function declarations
 * below should be made in the generic/tk.decls script.
 */

MODULE_SCOPE const TkStubs tkStubs;

/*
 * Remove macro that might interfere with the definition below.
 */

#undef Tk_MainEx











#ifndef __WIN32__

/* Make sure that extensions which call XParseColor through
 * the stub table, call TkParseColor in stead. See bug #3486474 */

#   define XParseColor TkParseColor








#endif




































/* !BEGIN!: Do not edit below this line. */

static const TkIntStubs tkIntStubs = {
    TCL_STUB_MAGIC,
    0,
    TkAllocWindow, /* 0 */







|







>
>
>
>
>
>
>
>
>
>

>
|
|
>
|
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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

/*
 * WARNING: The contents of this file is automatically generated by the
 * tools/genStubs.tcl script. Any modifications to the function declarations
 * below should be made in the generic/tk.decls script.
 */

static const TkIntStubs tkIntStubs;

/*
 * Remove macro that might interfere with the definition below.
 */

#undef Tk_MainEx

#undef TkClipBox
#undef TkCreateRegion
#undef TkDestroyRegion
#undef TkIntersectRegion
#undef TkRectInRegion
#undef TkSetRegion
#undef TkUnionRectWithRegion
#undef TkSubtractRegion
#undef TkPutImage

#ifndef __WIN32__
/*
 * Make sure that extensions which call XParseColor through the stub
 * table, call TkParseColor instead. [Bug 3486474]
 */
#   define XParseColor	TkParseColor

#   ifndef __CYGWIN__
#	define Tk_AttachHWND		0
#	define Tk_GetHWND		0
#	define Tk_HWNDToWindow		0
#	define Tk_PointerEvent		0
#	define Tk_TranslateWinEvent	0
#	define Tk_GetHINSTANCE		0
#   endif
#   if !defined(MAC_TCL) && !defined(MAC_OSX_TCL)
#	define TkClipBox (void (*) (TkRegion, XRectangle *)) XClipBox
#	define TkCreateRegion (TkRegion (*) ()) XCreateRegion
#	define TkDestroyRegion (void (*) (TkRegion)) XDestroyRegion
#	define TkIntersectRegion (void (*) (TkRegion, TkRegion, TkRegion)) XIntersectRegion
#	define TkRectInRegion (int (*) (TkRegion, int, int, unsigned int, unsigned int)) XRectInRegion
#	define TkSetRegion (void (*) (Display *, GC, TkRegion)) XSetRegion
#	define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion
#	define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion

#	ifdef __CYGWIN__
#	    define Tk_GetHINSTANCE	TkPlatGetHINSTANCE
#	    define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS	0x00000004

/*
 * Trick, so we don't have to include <windows.h> here, which in any
 * case lacks this function anyway.
 */

int __stdcall GetModuleHandleExW(unsigned int, const char *, void *);

static void *Tk_GetHINSTANCE()
{
    void *hInstance = NULL;

    GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
	    (const char *) &tkIntStubs, &hInstance);
    return hInstance;
}

#	else /* !__CYGWIN__ */
#	    define TkPutImage		0
#	endif /* __CYGWIN__ */
#   endif /* !MAC_TCL && !MACC_OSX_TCL */
#endif /* !__WIN32__ */

/* !BEGIN!: Do not edit below this line. */

static const TkIntStubs tkIntStubs = {
    TCL_STUB_MAGIC,
    0,
    TkAllocWindow, /* 0 */
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
    TkGetDisplayList, /* 106 */
    TkGetMainInfoList, /* 107 */
    TkGetWindowFromObj, /* 108 */
    TkpGetString, /* 109 */
    TkpGetSubFonts, /* 110 */
    TkpGetSystemDefault, /* 111 */
    TkpMenuThreadInit, /* 112 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 113 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkClipBox, /* 113 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 113 */ /* Dummy entry for stubs table backwards compatibility */
    TkClipBox, /* 113 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 114 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkCreateRegion, /* 114 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 114 */ /* Dummy entry for stubs table backwards compatibility */
    TkCreateRegion, /* 114 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 115 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkDestroyRegion, /* 115 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 115 */ /* Dummy entry for stubs table backwards compatibility */
    TkDestroyRegion, /* 115 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 116 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkIntersectRegion, /* 116 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 116 */ /* Dummy entry for stubs table backwards compatibility */
    TkIntersectRegion, /* 116 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 117 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkRectInRegion, /* 117 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 117 */ /* Dummy entry for stubs table backwards compatibility */
    TkRectInRegion, /* 117 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 118 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkSetRegion, /* 118 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 118 */ /* Dummy entry for stubs table backwards compatibility */
    TkSetRegion, /* 118 */
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 119 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkUnionRectWithRegion, /* 119 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 119 */ /* Dummy entry for stubs table backwards compatibility */
    TkUnionRectWithRegion, /* 119 */
#endif /* AQUA */
    0, /* 120 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 121 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    0, /* 121 */
#endif /* WIN */







<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<

<
<
<
<
<







219
220
221
222
223
224
225




226









227









228









229









230









231









232





233
234
235
236
237
238
239
    TkGetDisplayList, /* 106 */
    TkGetMainInfoList, /* 107 */
    TkGetWindowFromObj, /* 108 */
    TkpGetString, /* 109 */
    TkpGetSubFonts, /* 110 */
    TkpGetSystemDefault, /* 111 */
    TkpMenuThreadInit, /* 112 */




    TkClipBox, /* 113 */









    TkCreateRegion, /* 114 */









    TkDestroyRegion, /* 115 */









    TkIntersectRegion, /* 116 */









    TkRectInRegion, /* 117 */









    TkSetRegion, /* 118 */









    TkUnionRectWithRegion, /* 119 */





    0, /* 120 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 121 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    0, /* 121 */
#endif /* WIN */
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
    TkpGetKeySym, /* 138 */
    TkpInitKeymapInfo, /* 139 */
    TkPhotoGetValidRegion, /* 140 */
    TkWmStackorderToplevel, /* 141 */
    TkFocusFree, /* 142 */
    TkClipCleanup, /* 143 */
    TkGCCleanup, /* 144 */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
    0, /* 145 */
#endif /* X11 */
#ifdef __WIN32__ /* WIN */
    TkSubtractRegion, /* 145 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    0, /* 145 */ /* Dummy entry for stubs table backwards compatibility */
    TkSubtractRegion, /* 145 */
#endif /* AQUA */
    TkStylePkgInit, /* 146 */
    TkStylePkgFree, /* 147 */
    TkToplevelWindowForCommand, /* 148 */
    TkGetOptionSpec, /* 149 */
    TkMakeRawCurve, /* 150 */
    TkMakeRawCurvePostscript, /* 151 */
    TkpDrawFrame, /* 152 */







<
<
<
<

<
<
<
<
<







278
279
280
281
282
283
284




285





286
287
288
289
290
291
292
    TkpGetKeySym, /* 138 */
    TkpInitKeymapInfo, /* 139 */
    TkPhotoGetValidRegion, /* 140 */
    TkWmStackorderToplevel, /* 141 */
    TkFocusFree, /* 142 */
    TkClipCleanup, /* 143 */
    TkGCCleanup, /* 144 */




    TkSubtractRegion, /* 145 */





    TkStylePkgInit, /* 146 */
    TkStylePkgFree, /* 147 */
    TkToplevelWindowForCommand, /* 148 */
    TkGetOptionSpec, /* 149 */
    TkMakeRawCurve, /* 150 */
    TkMakeRawCurvePostscript, /* 151 */
    TkpDrawFrame, /* 152 */
664
665
666
667
668
669
670








671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
    XSync, /* 91 */
#endif /* AQUA */
};

static const TkPlatStubs tkPlatStubs = {
    TCL_STUB_MAGIC,
    0,








#ifdef __WIN32__ /* WIN */
    Tk_AttachHWND, /* 0 */
    Tk_GetHINSTANCE, /* 1 */
    Tk_GetHWND, /* 2 */
    Tk_HWNDToWindow, /* 3 */
    Tk_PointerEvent, /* 4 */
    Tk_TranslateWinEvent, /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    Tk_MacOSXSetEmbedHandler, /* 0 */
    Tk_MacOSXTurnOffMenus, /* 1 */
    Tk_MacOSXTkOwnsCursor, /* 2 */
    TkMacOSXInitMenus, /* 3 */
    TkMacOSXInitAppleEvents, /* 4 */
    TkGenWMConfigureEvent, /* 5 */
    TkMacOSXInvalClipRgns, /* 6 */
    TkMacOSXGetDrawablePort, /* 7 */
    TkMacOSXGetRootControl, /* 8 */
    Tk_MacOSXSetupTkNotifier, /* 9 */
    Tk_MacOSXIsAppInFront, /* 10 */
#endif /* AQUA */
};







>
>
>
>
>
>
>
>









|
|
|
|
|
|







647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
    XSync, /* 91 */
#endif /* AQUA */
};

static const TkPlatStubs tkPlatStubs = {
    TCL_STUB_MAGIC,
    0,
#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */
    Tk_AttachHWND, /* 0 */
    Tk_GetHINSTANCE, /* 1 */
    Tk_GetHWND, /* 2 */
    Tk_HWNDToWindow, /* 3 */
    Tk_PointerEvent, /* 4 */
    Tk_TranslateWinEvent, /* 5 */
#endif /* UNIX */
#ifdef __WIN32__ /* WIN */
    Tk_AttachHWND, /* 0 */
    Tk_GetHINSTANCE, /* 1 */
    Tk_GetHWND, /* 2 */
    Tk_HWNDToWindow, /* 3 */
    Tk_PointerEvent, /* 4 */
    Tk_TranslateWinEvent, /* 5 */
#endif /* WIN */
#ifdef MAC_OSX_TK /* AQUA */
    Tk_AttachHWND, /* 0 */
    Tk_GetHINSTANCE, /* 1 */
    Tk_GetHWND, /* 2 */
    Tk_HWNDToWindow, /* 3 */
    Tk_PointerEvent, /* 4 */
    Tk_TranslateWinEvent, /* 5 */
    TkMacOSXInvalClipRgns, /* 6 */
    TkMacOSXGetDrawablePort, /* 7 */
    TkMacOSXGetRootControl, /* 8 */
    Tk_MacOSXSetupTkNotifier, /* 9 */
    Tk_MacOSXIsAppInFront, /* 10 */
#endif /* AQUA */
};

Changes to generic/tkWindow.c.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*
 * Default values for "changes" and "atts" fields of TkWindows. Note that Tk
 * always requests all events for all windows, except StructureNotify events
 * on internal windows: these events are generated internally.
 */

static XWindowChanges defChanges = {
    0, 0, 1, 1, 0, 0, Above
};
#define ALL_EVENTS_MASK \
    KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \
    EnterWindowMask|LeaveWindowMask|PointerMotionMask|ExposureMask| \
    VisibilityChangeMask|PropertyChangeMask|ColormapChangeMask
static XSetWindowAttributes defAtts= {
    None,			/* background_pixmap */
    0,				/* background_pixel */
    CopyFromParent,		/* border_pixmap */
    0,				/* border_pixel */
    NorthWestGravity,		/* bit_gravity */
    NorthWestGravity,		/* win_gravity */
    NotUseful,			/* backing_store */







|






|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*
 * Default values for "changes" and "atts" fields of TkWindows. Note that Tk
 * always requests all events for all windows, except StructureNotify events
 * on internal windows: these events are generated internally.
 */

static const XWindowChanges defChanges = {
    0, 0, 1, 1, 0, 0, Above
};
#define ALL_EVENTS_MASK \
    KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \
    EnterWindowMask|LeaveWindowMask|PointerMotionMask|ExposureMask| \
    VisibilityChangeMask|PropertyChangeMask|ColormapChangeMask
static const XSetWindowAttributes defAtts= {
    None,			/* background_pixmap */
    0,				/* background_pixel */
    CopyFromParent,		/* border_pixmap */
    0,				/* border_pixel */
    NorthWestGravity,		/* bit_gravity */
    NorthWestGravity,		/* win_gravity */
    NotUseful,			/* backing_store */
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
    None			/* cursor */
};

/*
 * The following structure defines all of the commands supported by Tk, and
 * the C functions that execute them.
 */




typedef int (TkInitProc)(Tcl_Interp *interp, ClientData clientData);
typedef struct {
    const char *name;		/* Name of command. */
    Tcl_CmdProc *cmdProc;	/* Command's string-based function. */
    Tcl_ObjCmdProc *objProc;	/* Command's object-based function. */
    TkInitProc *initProc;	/* Command's initialization function */
    int isSafe;			/* If !0, this command will be exposed in a
				 * safe interpreter. Otherwise it will be
				 * hidden in a safe interpreter. */
    int passMainWindow;		/* 0 means provide NULL clientData to command
				 * function; 1 means pass main window as
				 * clientData to command function. */
} TkCmd;

static const TkCmd commands[] = {
    /*
     * Commands that are part of the intrinsics:
     */

    {"bell",		NULL,		Tk_BellObjCmd,		NULL, 0, 1},
    {"bind",		NULL,		Tk_BindObjCmd,		NULL, 1, 1},
    {"bindtags",	NULL,		Tk_BindtagsObjCmd,	NULL, 1, 1},
    {"clipboard",	NULL,		Tk_ClipboardObjCmd,	NULL, 0, 1},
    {"destroy",		NULL,		Tk_DestroyObjCmd,	NULL, 1, 1},
    {"event",		NULL,		Tk_EventObjCmd,		NULL, 1, 1},
    {"focus",		NULL,		Tk_FocusObjCmd,		NULL, 1, 1},
    {"font",		NULL,		Tk_FontObjCmd,		NULL, 1, 1},
    {"grab",		NULL,		Tk_GrabObjCmd,		NULL, 0, 1},
    {"grid",		NULL,		Tk_GridObjCmd,		NULL, 1, 1},
    {"image",		NULL,		Tk_ImageObjCmd,		NULL, 1, 1},
    {"lower",		NULL,		Tk_LowerObjCmd,		NULL, 1, 1},
    {"option",		NULL,		Tk_OptionObjCmd,	NULL, 1, 1},
    {"pack",		NULL,		Tk_PackObjCmd,		NULL, 1, 1},
    {"place",		NULL,		Tk_PlaceObjCmd,		NULL, 1, 1},
    {"raise",		NULL,		Tk_RaiseObjCmd,		NULL, 1, 1},
    {"selection",	NULL,		Tk_SelectionObjCmd,	NULL, 0, 1},
    {"tk",		NULL,		NULL,		TkInitTkCmd,  1, 1},
    {"tkwait",		NULL,		Tk_TkwaitObjCmd,	NULL, 1, 1},
    {"update",		NULL,		Tk_UpdateObjCmd,	NULL, 1, 1},
    {"winfo",		NULL,		Tk_WinfoObjCmd,		NULL, 1, 1},
    {"wm",		NULL,		Tk_WmObjCmd,		NULL, 0, 1},

    /*
     * Default widget class commands.
     */

    {"button",		NULL,		Tk_ButtonObjCmd,	NULL, 1, 0},
    {"canvas",		NULL,		Tk_CanvasObjCmd,	NULL, 1, 1},
    {"checkbutton",	NULL,		Tk_CheckbuttonObjCmd,	NULL, 1, 0},
    {"entry",		NULL,		Tk_EntryObjCmd,		NULL, 1, 0},
    {"frame",		NULL,		Tk_FrameObjCmd,		NULL, 1, 0},
    {"label",		NULL,		Tk_LabelObjCmd,		NULL, 1, 0},
    {"labelframe",	NULL,		Tk_LabelframeObjCmd,	NULL, 1, 0},
    {"listbox",		NULL,		Tk_ListboxObjCmd,	NULL, 1, 0},
    {"menubutton",	NULL,		Tk_MenubuttonObjCmd,	NULL, 1, 0},
    {"message",		NULL,		Tk_MessageObjCmd,	NULL, 1, 0},
    {"panedwindow",	NULL,		Tk_PanedWindowObjCmd,	NULL, 1, 0},
    {"radiobutton",	NULL,		Tk_RadiobuttonObjCmd,	NULL, 1, 0},
    {"scale",		NULL,		Tk_ScaleObjCmd,		NULL, 1, 0},
    {"scrollbar",	Tk_ScrollbarCmd,NULL,			NULL, 1, 1},
    {"spinbox",		NULL,		Tk_SpinboxObjCmd,	NULL, 1, 0},
    {"text",		NULL,		Tk_TextObjCmd,		NULL, 1, 1},
    {"toplevel",	NULL,		Tk_ToplevelObjCmd,	NULL, 0, 0},

    /*
     * Classic widget class commands.
     */

    {"::tk::button",	NULL,		Tk_ButtonObjCmd,	NULL, 1, 0},
    {"::tk::canvas",	NULL,		Tk_CanvasObjCmd,	NULL, 1, 1},
    {"::tk::checkbutton",NULL,		Tk_CheckbuttonObjCmd,	NULL, 1, 0},
    {"::tk::entry",	NULL,		Tk_EntryObjCmd,		NULL, 1, 0},
    {"::tk::frame",	NULL,		Tk_FrameObjCmd,		NULL, 1, 0},
    {"::tk::label",	NULL,		Tk_LabelObjCmd,		NULL, 1, 0},
    {"::tk::labelframe",NULL,		Tk_LabelframeObjCmd,	NULL, 1, 0},
    {"::tk::listbox",	NULL,		Tk_ListboxObjCmd,	NULL, 1, 0},
    {"::tk::menubutton",NULL,		Tk_MenubuttonObjCmd,	NULL, 1, 0},
    {"::tk::message",	NULL,		Tk_MessageObjCmd,	NULL, 1, 0},
    {"::tk::panedwindow",NULL,		Tk_PanedWindowObjCmd,	NULL, 1, 0},
    {"::tk::radiobutton",NULL,		Tk_RadiobuttonObjCmd,	NULL, 1, 0},
    {"::tk::scale",	NULL,		Tk_ScaleObjCmd,		NULL, 1, 0},
    {"::tk::scrollbar",	Tk_ScrollbarCmd,NULL,			NULL, 1, 1},
    {"::tk::spinbox",	NULL,		Tk_SpinboxObjCmd,	NULL, 1, 0},
    {"::tk::text",	NULL,		Tk_TextObjCmd,		NULL, 1, 1},
    {"::tk::toplevel",	NULL,		Tk_ToplevelObjCmd,	NULL, 0, 0},

    /*
     * Standard dialog support. Note that the Unix/X11 platform implements
     * these commands differently (via the script library).
     */

#if defined(__WIN32__) || defined(MAC_OSX_TK)
    {"tk_chooseColor",	NULL,		Tk_ChooseColorObjCmd,	NULL, 0, 1},
    {"tk_chooseDirectory", NULL,	Tk_ChooseDirectoryObjCmd,NULL, 0,1},
    {"tk_getOpenFile",	NULL,		Tk_GetOpenFileObjCmd,	NULL, 0, 1},
    {"tk_getSaveFile",	NULL,		Tk_GetSaveFileObjCmd,	NULL, 0, 1},
    {"tk_messageBox",	NULL,		Tk_MessageBoxObjCmd,	NULL, 0, 1},
#endif

    /*
     * Misc.
     */

#if defined(MAC_OSX_TK)
    {"::tk::unsupported::MacWindowStyle",
			NULL,		TkUnsupported1ObjCmd,	NULL, 1, 1},
#endif
    {NULL,		NULL,		NULL,			NULL, 0, 0}
};

/*
 * The variables and table below are used to parse arguments from the "argv"
 * variable in Tk_Init.
 */








>
>
>
>






<
<
|
<
<
<







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|





|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|





|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|







|
|
|
|
|








|

|







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
    None			/* cursor */
};

/*
 * The following structure defines all of the commands supported by Tk, and
 * the C functions that execute them.
 */

#define ISSAFE 1
#define PASSMAINWINDOW 2

typedef int (TkInitProc)(Tcl_Interp *interp, ClientData clientData);
typedef struct {
    const char *name;		/* Name of command. */
    Tcl_CmdProc *cmdProc;	/* Command's string-based function. */
    Tcl_ObjCmdProc *objProc;	/* Command's object-based function. */
    TkInitProc *initProc;	/* Command's initialization function */


    int flags;



} TkCmd;

static const TkCmd commands[] = {
    /*
     * Commands that are part of the intrinsics:
     */

    {"bell",		NULL,		Tk_BellObjCmd,		NULL, PASSMAINWINDOW},
    {"bind",		NULL,		Tk_BindObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"bindtags",	NULL,		Tk_BindtagsObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"clipboard",	NULL,		Tk_ClipboardObjCmd,	NULL, PASSMAINWINDOW},
    {"destroy",		NULL,		Tk_DestroyObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"event",		NULL,		Tk_EventObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"focus",		NULL,		Tk_FocusObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"font",		NULL,		Tk_FontObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"grab",		NULL,		Tk_GrabObjCmd,		NULL, PASSMAINWINDOW},
    {"grid",		NULL,		Tk_GridObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"image",		NULL,		Tk_ImageObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"lower",		NULL,		Tk_LowerObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"option",		NULL,		Tk_OptionObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"pack",		NULL,		Tk_PackObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"place",		NULL,		Tk_PlaceObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"raise",		NULL,		Tk_RaiseObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"selection",	NULL,		Tk_SelectionObjCmd,	NULL, PASSMAINWINDOW},
    {"tk",		NULL,		NULL,		TkInitTkCmd,  PASSMAINWINDOW|ISSAFE},
    {"tkwait",		NULL,		Tk_TkwaitObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"update",		NULL,		Tk_UpdateObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"winfo",		NULL,		Tk_WinfoObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"wm",		NULL,		Tk_WmObjCmd,		NULL, PASSMAINWINDOW},

    /*
     * Default widget class commands.
     */

    {"button",		NULL,		Tk_ButtonObjCmd,	NULL, ISSAFE},
    {"canvas",		NULL,		Tk_CanvasObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"checkbutton",	NULL,		Tk_CheckbuttonObjCmd,	NULL, ISSAFE},
    {"entry",		NULL,		Tk_EntryObjCmd,		NULL, ISSAFE},
    {"frame",		NULL,		Tk_FrameObjCmd,		NULL, ISSAFE},
    {"label",		NULL,		Tk_LabelObjCmd,		NULL, ISSAFE},
    {"labelframe",	NULL,		Tk_LabelframeObjCmd,	NULL, ISSAFE},
    {"listbox",		NULL,		Tk_ListboxObjCmd,	NULL, ISSAFE},
    {"menubutton",	NULL,		Tk_MenubuttonObjCmd,	NULL, ISSAFE},
    {"message",		NULL,		Tk_MessageObjCmd,	NULL, ISSAFE},
    {"panedwindow",	NULL,		Tk_PanedWindowObjCmd,	NULL, ISSAFE},
    {"radiobutton",	NULL,		Tk_RadiobuttonObjCmd,	NULL, ISSAFE},
    {"scale",		NULL,		Tk_ScaleObjCmd,		NULL, ISSAFE},
    {"scrollbar",	Tk_ScrollbarCmd,NULL,			NULL, PASSMAINWINDOW|ISSAFE},
    {"spinbox",		NULL,		Tk_SpinboxObjCmd,	NULL, ISSAFE},
    {"text",		NULL,		Tk_TextObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"toplevel",	NULL,		Tk_ToplevelObjCmd,	NULL, 0},

    /*
     * Classic widget class commands.
     */

    {"::tk::button",	NULL,		Tk_ButtonObjCmd,	NULL, ISSAFE},
    {"::tk::canvas",	NULL,		Tk_CanvasObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
    {"::tk::checkbutton",NULL,		Tk_CheckbuttonObjCmd,	NULL, ISSAFE},
    {"::tk::entry",	NULL,		Tk_EntryObjCmd,		NULL, ISSAFE},
    {"::tk::frame",	NULL,		Tk_FrameObjCmd,		NULL, ISSAFE},
    {"::tk::label",	NULL,		Tk_LabelObjCmd,		NULL, ISSAFE},
    {"::tk::labelframe",NULL,		Tk_LabelframeObjCmd,	NULL, ISSAFE},
    {"::tk::listbox",	NULL,		Tk_ListboxObjCmd,	NULL, ISSAFE},
    {"::tk::menubutton",NULL,		Tk_MenubuttonObjCmd,	NULL, ISSAFE},
    {"::tk::message",	NULL,		Tk_MessageObjCmd,	NULL, ISSAFE},
    {"::tk::panedwindow",NULL,		Tk_PanedWindowObjCmd,	NULL, ISSAFE},
    {"::tk::radiobutton",NULL,		Tk_RadiobuttonObjCmd,	NULL, ISSAFE},
    {"::tk::scale",	NULL,		Tk_ScaleObjCmd,		NULL, ISSAFE},
    {"::tk::scrollbar",	Tk_ScrollbarCmd,NULL,			NULL, PASSMAINWINDOW|ISSAFE},
    {"::tk::spinbox",	NULL,		Tk_SpinboxObjCmd,	NULL, ISSAFE},
    {"::tk::text",	NULL,		Tk_TextObjCmd,		NULL, PASSMAINWINDOW|ISSAFE},
    {"::tk::toplevel",	NULL,		Tk_ToplevelObjCmd,	NULL, 0},

    /*
     * Standard dialog support. Note that the Unix/X11 platform implements
     * these commands differently (via the script library).
     */

#if defined(__WIN32__) || defined(MAC_OSX_TK)
    {"tk_chooseColor",	NULL,		Tk_ChooseColorObjCmd,	NULL, PASSMAINWINDOW},
    {"tk_chooseDirectory", NULL,	Tk_ChooseDirectoryObjCmd,NULL,PASSMAINWINDOW},
    {"tk_getOpenFile",	NULL,		Tk_GetOpenFileObjCmd,	NULL, PASSMAINWINDOW},
    {"tk_getSaveFile",	NULL,		Tk_GetSaveFileObjCmd,	NULL, PASSMAINWINDOW},
    {"tk_messageBox",	NULL,		Tk_MessageBoxObjCmd,	NULL, PASSMAINWINDOW},
#endif

    /*
     * Misc.
     */

#if defined(MAC_OSX_TK)
    {"::tk::unsupported::MacWindowStyle",
			NULL,		TkUnsupported1ObjCmd,	NULL, PASSMAINWINDOW|ISSAFE},
#endif
    {NULL,		NULL,		NULL,			NULL, 0}
};

/*
 * The variables and table below are used to parse arguments from the "argv"
 * variable in Tk_Init.
 */

947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976

    isSafe = Tcl_IsSafe(interp);
    for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) {
	if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)
		&& (cmdPtr->initProc == NULL)) {
	    Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs");
	}
	if (cmdPtr->passMainWindow) {
	    clientData = tkwin;
	} else {
	    clientData = NULL;
	}
	if (cmdPtr->initProc != NULL) {
	    cmdPtr->initProc(interp, clientData);
	} else if (cmdPtr->cmdProc != NULL) {
	    Tcl_CreateCommand(interp, cmdPtr->name, cmdPtr->cmdProc,
		    clientData, NULL);
	} else {
	    Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc,
		    clientData, NULL);
	}
	if (isSafe) {
	    if (!(cmdPtr->isSafe)) {
		Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name);
	    }
	}
    }

    TkCreateMenuCmd(interp);








|














|







946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975

    isSafe = Tcl_IsSafe(interp);
    for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) {
	if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)
		&& (cmdPtr->initProc == NULL)) {
	    Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs");
	}
	if (cmdPtr->flags & PASSMAINWINDOW) {
	    clientData = tkwin;
	} else {
	    clientData = NULL;
	}
	if (cmdPtr->initProc != NULL) {
	    cmdPtr->initProc(interp, clientData);
	} else if (cmdPtr->cmdProc != NULL) {
	    Tcl_CreateCommand(interp, cmdPtr->name, cmdPtr->cmdProc,
		    clientData, NULL);
	} else {
	    Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc,
		    clientData, NULL);
	}
	if (isSafe) {
	    if (!(cmdPtr->flags & ISSAFE)) {
		Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name);
	    }
	}
    }

    TkCreateMenuCmd(interp);

Changes to library/bgerror.tcl.

216
217
218
219
220
221
222


223
224
225
226
227
228
229
230

    bind $dlg <Return>	[namespace code {Return ok 0}]
    bind $dlg <Escape>	[namespace code {Return dismiss 1}]
    bind $dlg <Destroy>	[namespace code {Destroy %W}]
    bind $dlg.function <Return>	[namespace code {ReturnInDetails %W}]
    $dlg.function configure -command [namespace code Details]



    # 6. Place the window (centered in the display) and deiconify it.

    ::tk::PlaceWindow $dlg

    # 7. Set a grab and claim the focus too.

    ::tk::SetFocusGrab $dlg $dlg.ok








>
>
|







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232

    bind $dlg <Return>	[namespace code {Return ok 0}]
    bind $dlg <Escape>	[namespace code {Return dismiss 1}]
    bind $dlg <Destroy>	[namespace code {Destroy %W}]
    bind $dlg.function <Return>	[namespace code {ReturnInDetails %W}]
    $dlg.function configure -command [namespace code Details]

    # 6. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.

    ::tk::PlaceWindow $dlg

    # 7. Set a grab and claim the focus too.

    ::tk::SetFocusGrab $dlg $dlg.ok

Changes to library/choosedir.tcl.

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

    set data(filter) "*"
    set data(previousEntryText) ""
    ::tk::dialog::file::UpdateWhenIdle $w

    # Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(ent)







|







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

    set data(filter) "*"
    set data(previousEntryText) ""
    ::tk::dialog::file::UpdateWhenIdle $w

    # Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(ent)

Changes to library/clrpick.tcl.

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

    if {[winfo viewable [winfo toplevel $data(-parent)]] } {
	wm transient $w $data(-parent)
    }

    # 5. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # 6. Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(okBtn)







|







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

    if {[winfo viewable [winfo toplevel $data(-parent)]] } {
	wm transient $w $data(-parent)
    }

    # 5. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # 6. Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(okBtn)

Changes to library/dialog.tcl.

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
    # button variable to -1;  this is needed in case something happens
    # that destroys the window, such as its parent window being destroyed.

    bind $w <Destroy> {set ::tk::Priv(button) -1}

    # 6. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display and de-iconify it.

    wm withdraw $w
    update idletasks
    set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \
	    - [winfo vrootx [winfo parent $w]]}]
    set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \
	    - [winfo vrooty [winfo parent $w]]}]
    # Make sure that the window is on the screen and set the maximum
    # size of the window is the size of the screen.  That'll let things
    # fail fairly gracefully when very large messages are used. [Bug 827535]
    if {$x < 0} {
	set x 0
    }
    if {$y < 0} {
	set y 0
    }
    wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w]
    wm geometry $w +$x+$y
    wm deiconify $w

    tkwait visibility $w

    # 7. Set a grab and claim the focus too.

    if {$default >= 0} {
        set focus $w.button$default
    } else {







|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







142
143
144
145
146
147
148
149
150


















151
152
153
154
155
156
157
158
    # button variable to -1;  this is needed in case something happens
    # that destroys the window, such as its parent window being destroyed.

    bind $w <Destroy> {set ::tk::Priv(button) -1}

    # 6. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.



















    ::tk::PlaceWindow $w 
    tkwait visibility $w

    # 7. Set a grab and claim the focus too.

    if {$default >= 0} {
        set focus $w.button$default
    } else {

Changes to library/msgbox.tcl.

391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
    bind $w <Escape> [list $w.$cancel invoke]

    # At <Destroy> the buttons have vanished, so must do this directly.
    bind $w.msg <Destroy> [list set tk::Priv(button) $cancel]

    # 7. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)

    # 8. Set a grab and claim the focus too.

    if {$data(-default) ne ""} {
	set focus $w.$data(-default)







|







391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
    bind $w <Escape> [list $w.$cancel invoke]

    # At <Destroy> the buttons have vanished, so must do this directly.
    bind $w.msg <Destroy> [list set tk::Priv(button) $cancel]

    # 7. Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)

    # 8. Set a grab and claim the focus too.

    if {$data(-default) ne ""} {
	set focus $w.$data(-default)

Changes to library/tk.tcl.

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
	set y [expr {[winfo rooty $anchor] + \
		([winfo height $anchor]-[winfo reqheight $w])/2}]
    } else {
	set x [expr {([winfo screenwidth $w]-[winfo reqwidth $w])/2}]
	set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
	set checkBounds 0
    }
    if {[tk windowingsystem] eq "win32"} {
        # Bug 533519: win32 multiple desktops may produce negative geometry.
        set checkBounds 0
    }
    if {$checkBounds} {
	if {$x < 0} {
	    set x 0
	} elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} {
	    set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}]
	}
	if {$y < 0} {
	    set y 0
	} elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} {
	    set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}]
	}
	if {[tk windowingsystem] eq "aqua"} {
	    # Avoid the native menu bar which sits on top of everything.
	    if {$y < 22} {
		set y 22
	    }
	}
    }

    wm geometry $w +$x+$y
    wm deiconify $w
}

# ::tk::SetFocusGrab --
#   swap out current focus and grab temporarily (for dialogs)
# Arguments:







<
<
<
<

|
|
|
|

|
|
|
|








>







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
	set y [expr {[winfo rooty $anchor] + \
		([winfo height $anchor]-[winfo reqheight $w])/2}]
    } else {
	set x [expr {([winfo screenwidth $w]-[winfo reqwidth $w])/2}]
	set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}]
	set checkBounds 0
    }




    if {$checkBounds} {
	if {$x < [winfo vrootx $w]} {
	    set x [winfo vrootx $w]
	} elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} {
	    set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}]
	}
	if {$y < [winfo vrooty $w]} {
	    set y [winfo vrooty $w]
	} elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} {
	    set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}]
	}
	if {[tk windowingsystem] eq "aqua"} {
	    # Avoid the native menu bar which sits on top of everything.
	    if {$y < 22} {
		set y 22
	    }
	}
    }
    wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w]
    wm geometry $w +$x+$y
    wm deiconify $w
}

# ::tk::SetFocusGrab --
#   swap out current focus and grab temporarily (for dialogs)
# Arguments:

Changes to library/tkfbox.tcl.

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
    } else {
	set data(filter) "*"
	$data(typeMenuBtn) configure -state disabled -takefocus 0
	$data(typeMenuLab) configure -state disabled
    }
    UpdateWhenIdle $w

    # Withdraw the window, then update all the geometry information so we know
    # how big it wants to be, then center the window in the display and
    # de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(ent)







|
|
|







192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
    } else {
	set data(filter) "*"
	$data(typeMenuBtn) configure -state disabled -takefocus 0
	$data(typeMenuLab) configure -state disabled
    }
    UpdateWhenIdle $w

    # Withdraw the window, then update all the geometry information
    # so we know how big it wants to be, then center the window in the
    # display (Motif style) and de-iconify it.

    ::tk::PlaceWindow $w widget $data(-parent)
    wm title $w $data(-title)

    # Set a grab and claim the focus too.

    ::tk::SetFocusGrab $w $data(ent)

Changes to unix/Makefile.in.

720
721
722
723
724
725
726


727




728

729
730
731
732
733
734
735
	    done;
	@if test "x$(TK_SHARED_BUILD)" = "x1"; then \
	    echo "Creating package index $(PKG_INDEX)"; \
	    rm -f "$(PKG_INDEX)"; \
	    (\
	    echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\
	    relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\


	    echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL)\




		[list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\

	    ) > "$(PKG_INDEX)"; \
	    fi
	@echo "Installing $(LIB_FILE) to @DLL_INSTALL_DIR@/"
	@@INSTALL_LIB@
	@chmod 555 "@DLL_INSTALL_DIR@"/$(LIB_FILE)
	@echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}"
	@$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX}







>
>
|
>
>
>
>
|
>







720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
	    done;
	@if test "x$(TK_SHARED_BUILD)" = "x1"; then \
	    echo "Creating package index $(PKG_INDEX)"; \
	    rm -f "$(PKG_INDEX)"; \
	    (\
	    echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\
	    relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\
	    echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\
	    echo "    if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\
	    echo "	package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\
	    echo "    } else {";\
	    echo "	package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\
	    echo "    }";\
	    echo "} else {";\
	    echo "    package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\
	    echo "}";\
	    ) > "$(PKG_INDEX)"; \
	    fi
	@echo "Installing $(LIB_FILE) to @DLL_INSTALL_DIR@/"
	@@INSTALL_LIB@
	@chmod 555 "@DLL_INSTALL_DIR@"/$(LIB_FILE)
	@echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}"
	@$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX}

Changes to unix/tkUnixPort.h.

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
 * Define "NBBY" (number of bits per byte) if it's not already defined.
 */

#ifndef NBBY
#   define NBBY 8
#endif

/*
 * These macros are just wrappers for the equivalent X Region calls.
 */

#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
#define TkCreateRegion() (TkRegion) XCreateRegion()
#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
	(Region) b, (Region) r)
#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \
	(Region) b, (Region) r)
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
	(Region) src, (Region) ret)

/*
 * The TkPutImage macro strips off the color table information, which isn't
 * needed for X.
 */

#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
	XPutImage(display, pixels, gc, image, srcx, srcy, destx, \







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







109
110
111
112
113
114
115
















116
117
118
119
120
121
122
 * Define "NBBY" (number of bits per byte) if it's not already defined.
 */

#ifndef NBBY
#   define NBBY 8
#endif

















/*
 * The TkPutImage macro strips off the color table information, which isn't
 * needed for X.
 */

#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
	XPutImage(display, pixels, gc, image, srcx, srcy, destx, \

Changes to win/rules.vc.

469
470
471
472
473
474
475
476
477
478
479

480
481
482
483
484
485
486
487


488
489
490
491
492
493
494
!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" || "$(MACHINE)" == "AMD64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif




#----------------------------------------------------------
# Locate the Tcl headers to build against
#----------------------------------------------------------

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








|
|
|

>







|
>
>







469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
!if $(STATIC_BUILD)
OPTDEFINES	= $(OPTDEFINES) -DSTATIC_BUILD
!endif
!if $(TCL_NO_DEPRECATED)
OPTDEFINES	= $(OPTDEFINES) -DTCL_NO_DEPRECATED
!endif

!if !$(DEBUG)
OPTDEFINES	= $(OPTDEFINES) -DNDEBUG
!if $(OPTIMIZING)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_OPTIMIZED
!endif
!endif
!if $(PROFILE)
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_PROFILED
!endif
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
OPTDEFINES	= $(OPTDEFINES) -DTCL_CFG_DO64BIT
!endif
!if $(VCVERSION) < 1300
OPTDEFINES	= $(OPTDEFINES) -DNO_STRTOI64
!endif

#----------------------------------------------------------
# Locate the Tcl headers to build against
#----------------------------------------------------------

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

Changes to win/tkWinWm.c.

6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
    Tk_Window tkwin,		/* Window whose virtual root is to be
				 * queried. */
    int *xPtr, int *yPtr,	/* Store x and y offsets of virtual root
				 * here. */
    int *widthPtr, int *heightPtr)
				/* Store dimensions of virtual root here. */
{
    TkWindow *winPtr = (TkWindow *) tkwin;

    /*
     * XXX: This is not correct for multiple monitors. There may be many
     * changes required to get this right, and it may effect existing
     * applications that don't consider possible <0 vroot. See
     * http://msdn.microsoft.com/library/en-us/gdi/monitor_3lrn.asp for more
     * info.
     */

    *xPtr = 0;
    *yPtr = 0;
    *widthPtr = DisplayWidth(winPtr->display, winPtr->screenNum);
    *heightPtr = DisplayHeight(winPtr->display, winPtr->screenNum);
}

/*
 *----------------------------------------------------------------------
 *
 * Tk_MoveToplevelWindow --
 *







<
<
<
<
<
<
<
<
<
<
|
|
|
|







6397
6398
6399
6400
6401
6402
6403










6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
    Tk_Window tkwin,		/* Window whose virtual root is to be
				 * queried. */
    int *xPtr, int *yPtr,	/* Store x and y offsets of virtual root
				 * here. */
    int *widthPtr, int *heightPtr)
				/* Store dimensions of virtual root here. */
{










    *xPtr = GetSystemMetrics(SM_XVIRTUALSCREEN);
    *yPtr = GetSystemMetrics(SM_YVIRTUALSCREEN);
    *widthPtr = GetSystemMetrics(SM_CXVIRTUALSCREEN);
    *heightPtr = GetSystemMetrics(SM_CYVIRTUALSCREEN);
}

/*
 *----------------------------------------------------------------------
 *
 * Tk_MoveToplevelWindow --
 *