Tk Source Code

Check-in [40704173]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Merged core-8-5-branch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-438
Files: files | file ages | folders
SHA1:40704173372fef30b2ef0eb05c43f95abfbf8ad1
User & Date: fvogel 2015-12-09 19:27:17
Original Comment: Merged core-8-5branch
Context
2015-12-13
20:10
Merged core-8-5-branch check-in: 5a61887f user: fvogel tags: tip-438
2015-12-09
19:27
Merged core-8-5-branch check-in: 40704173 user: fvogel tags: tip-438
2015-12-07
02:04
Fix for zombie windows on El Capitan/OS X 10.11; thanks to Marc Culler for patch check-in: 36ad13aa user: kevin_walzer tags: core-8-5-branch
2015-11-28
22:35
Clearer separation between what [.text sync] and [.text sync -command] exactly perform check-in: f72cd1f4 user: fvogel tags: tip-438
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
....
2607
2608
2609
2610
2611
2612
2613










2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
....
2714
2715
2716
2717
2718
2719
2720




2721
2722
2723
2724

2725
2726
2727
2728
2729
2730




2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
....
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
....
2817
2818
2819
2820
2821
2822
2823




2824
2825
2826

2827
2828
2829
2830
2831
2832
2833
2834




2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
    int rightX;			/* Right edge of chunkPtr. */
    int rightX2;		/* Right edge of chunkPtr2. */
    int matchLeft;		/* Does the style of this line match that of
				 * its neighbor just to the left of the
				 * current x coordinate? */
    int matchRight;		/* Does line's style match its neighbor just
				 * to the right of the current x-coord? */
    int minX, maxX, xOffset;
    StyleValues *sValuePtr;
    Display *display;
#ifndef TK_NO_DOUBLE_BUFFERING
    const int y = 0;
#else
    const int y = dlPtr->y;
#endif /* TK_NO_DOUBLE_BUFFERING */
................................................................................

	    if ((leftX + xOffset) < -(sValuePtr->borderWidth)) {
		leftX = -sValuePtr->borderWidth - xOffset;
	    }
	    if ((rightX - leftX) > 32767) {
		rightX = leftX + 32767;
	    }











	    XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC,
		    leftX + xOffset, y, (unsigned int) (rightX - leftX),
		    (unsigned int) dlPtr->height);
	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
			leftX + xOffset, y, sValuePtr->borderWidth,
			dlPtr->height, 1, sValuePtr->relief);
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
			rightX - sValuePtr->borderWidth + xOffset,
			y, sValuePtr->borderWidth, dlPtr->height, 0,
			sValuePtr->relief);
	    }
	}
	leftX = rightX;
    }

    /*
................................................................................
	 * matches the current line on one side of the change but not on the
	 * other, we have to draw an L-shaped piece of bevel.
	 */

	matchRight = (nextPtr2 != NULL)
		&& SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr);
	if (matchLeft && !matchRight) {




	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
			rightX2 - sValuePtr->borderWidth + xOffset, y,
			sValuePtr->borderWidth, sValuePtr->borderWidth, 0,

			sValuePtr->relief);
	    }
	    leftX = rightX2 - sValuePtr->borderWidth;
	    leftXIn = 0;
	} else if (!matchLeft && matchRight
		&& (sValuePtr->relief != TK_RELIEF_FLAT)) {




	    Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    rightX2 + xOffset, y, sValuePtr->borderWidth,
		    sValuePtr->borderWidth, 1, sValuePtr->relief);
	    Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    leftX + xOffset, y, rightX2 + sValuePtr->borderWidth - 
		    leftX, sValuePtr->borderWidth, leftXIn, 0, 1,
		    sValuePtr->relief);
	}

    nextChunk2:
	chunkPtr2 = nextPtr2;
	if (chunkPtr2 == NULL) {
	    rightX2 = INT_MAX;
................................................................................
    rightX = chunkPtr->x + chunkPtr->width;
    if ((chunkPtr->nextPtr == NULL) && (rightX < maxX)) {
	rightX = maxX;
    }
    chunkPtr2 = NULL;
    if (dlPtr->nextPtr != NULL && dlPtr->nextPtr->chunkPtr != NULL) {
	/*
	 * Find the chunk in the previous line that covers leftX.
	 */

	nextPtr2 = dlPtr->nextPtr->chunkPtr;
	rightX2 = 0;			/* See Note A above. */
	while (rightX2 <= leftX) {
	    chunkPtr2 = nextPtr2;
	    if (chunkPtr2 == NULL) {
................................................................................
	    }
	    continue;
	}

	matchRight = (nextPtr2 != NULL)
		&& SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr);
	if (matchLeft && !matchRight) {




	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
			rightX2 - sValuePtr->borderWidth + xOffset,

			y + dlPtr->height - sValuePtr->borderWidth,
			sValuePtr->borderWidth, sValuePtr->borderWidth, 0,
			sValuePtr->relief);
	    }
	    leftX = rightX2 - sValuePtr->borderWidth;
	    leftXIn = 1;
	} else if (!matchLeft && matchRight
		&& (sValuePtr->relief != TK_RELIEF_FLAT)) {




	    Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    rightX2 + xOffset, y + dlPtr->height -
		    sValuePtr->borderWidth, sValuePtr->borderWidth,
		    sValuePtr->borderWidth, 1, sValuePtr->relief);
	    Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    leftX + xOffset, y + dlPtr->height -
		    sValuePtr->borderWidth, rightX2 + sValuePtr->borderWidth -
		    leftX, sValuePtr->borderWidth, leftXIn, 1, 0,
		    sValuePtr->relief);
	}

    nextChunk2b:
	chunkPtr2 = nextPtr2;
	if (chunkPtr2 == NULL) {
	    rightX2 = INT_MAX;
	} else {







|







 







>
>
>
>
>
>
>
>
>
>






|
|

<
|







 







>
>
>
>


<
<
>
|

|



>
>
>
>

|
|

|
|







 







|







 







>
>
>
>


<
>

|
<

|



>
>
>
>

|
|


|
|
|
|







2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
....
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632

2633
2634
2635
2636
2637
2638
2639
2640
....
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735


2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
....
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
....
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845

2846
2847
2848

2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
    int rightX;			/* Right edge of chunkPtr. */
    int rightX2;		/* Right edge of chunkPtr2. */
    int matchLeft;		/* Does the style of this line match that of
				 * its neighbor just to the left of the
				 * current x coordinate? */
    int matchRight;		/* Does line's style match its neighbor just
				 * to the right of the current x-coord? */
    int minX, maxX, xOffset, bw;
    StyleValues *sValuePtr;
    Display *display;
#ifndef TK_NO_DOUBLE_BUFFERING
    const int y = 0;
#else
    const int y = dlPtr->y;
#endif /* TK_NO_DOUBLE_BUFFERING */
................................................................................

	    if ((leftX + xOffset) < -(sValuePtr->borderWidth)) {
		leftX = -sValuePtr->borderWidth - xOffset;
	    }
	    if ((rightX - leftX) > 32767) {
		rightX = leftX + 32767;
	    }

            /*
             * Prevent the borders from leaking on adjacent characters,
             * which would happen for too large border width.
             */

            bw = sValuePtr->borderWidth;
            if (leftX + sValuePtr->borderWidth > rightX) {
                bw = rightX - leftX;
            }

	    XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC,
		    leftX + xOffset, y, (unsigned int) (rightX - leftX),
		    (unsigned int) dlPtr->height);
	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
			leftX + xOffset, y, bw, dlPtr->height, 1,
			sValuePtr->relief);
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,

			rightX - bw + xOffset, y, bw, dlPtr->height, 0,
			sValuePtr->relief);
	    }
	}
	leftX = rightX;
    }

    /*
................................................................................
	 * matches the current line on one side of the change but not on the
	 * other, we have to draw an L-shaped piece of bevel.
	 */

	matchRight = (nextPtr2 != NULL)
		&& SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr);
	if (matchLeft && !matchRight) {
            bw = sValuePtr->borderWidth;
            if (rightX2 - sValuePtr->borderWidth < leftX) {
                bw = rightX2 - leftX;
            }
	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,


			rightX2 - bw + xOffset, y, bw,
			sValuePtr->borderWidth, 0, sValuePtr->relief);
	    }
            leftX = rightX2 - bw;
	    leftXIn = 0;
	} else if (!matchLeft && matchRight
		&& (sValuePtr->relief != TK_RELIEF_FLAT)) {
            bw = sValuePtr->borderWidth;
            if (rightX2 + sValuePtr->borderWidth > rightX) {
                bw = rightX - rightX2;
            }
	    Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    rightX2 + xOffset, y, bw, sValuePtr->borderWidth,
		    1, sValuePtr->relief);
	    Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    leftX + xOffset, y, rightX2 + bw - leftX,
		    sValuePtr->borderWidth, leftXIn, 0, 1,
		    sValuePtr->relief);
	}

    nextChunk2:
	chunkPtr2 = nextPtr2;
	if (chunkPtr2 == NULL) {
	    rightX2 = INT_MAX;
................................................................................
    rightX = chunkPtr->x + chunkPtr->width;
    if ((chunkPtr->nextPtr == NULL) && (rightX < maxX)) {
	rightX = maxX;
    }
    chunkPtr2 = NULL;
    if (dlPtr->nextPtr != NULL && dlPtr->nextPtr->chunkPtr != NULL) {
	/*
	 * Find the chunk in the next line that covers leftX.
	 */

	nextPtr2 = dlPtr->nextPtr->chunkPtr;
	rightX2 = 0;			/* See Note A above. */
	while (rightX2 <= leftX) {
	    chunkPtr2 = nextPtr2;
	    if (chunkPtr2 == NULL) {
................................................................................
	    }
	    continue;
	}

	matchRight = (nextPtr2 != NULL)
		&& SAME_BACKGROUND(nextPtr2->stylePtr, chunkPtr->stylePtr);
	if (matchLeft && !matchRight) {
            bw = sValuePtr->borderWidth;
            if (rightX2 - sValuePtr->borderWidth < leftX) {
                bw = rightX2 - leftX;
            }
	    if (sValuePtr->relief != TK_RELIEF_FLAT) {
		Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,

			rightX2 - bw + xOffset,
			y + dlPtr->height - sValuePtr->borderWidth,
			bw, sValuePtr->borderWidth, 0, sValuePtr->relief);

	    }
	    leftX = rightX2 - bw;
	    leftXIn = 1;
	} else if (!matchLeft && matchRight
		&& (sValuePtr->relief != TK_RELIEF_FLAT)) {
            bw = sValuePtr->borderWidth;
            if (rightX2 + sValuePtr->borderWidth > rightX) {
                bw = rightX - rightX2;
            }
	    Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    rightX2 + xOffset,
		    y + dlPtr->height - sValuePtr->borderWidth, bw,
		    sValuePtr->borderWidth, 1, sValuePtr->relief);
	    Tk_3DHorizontalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
		    leftX + xOffset,
		    y + dlPtr->height - sValuePtr->borderWidth,
		    rightX2 + bw - leftX, sValuePtr->borderWidth, leftXIn,
		    1, 0, sValuePtr->relief);
	}

    nextChunk2b:
	chunkPtr2 = nextPtr2;
	if (chunkPtr2 == NULL) {
	    rightX2 = INT_MAX;
	} else {

Changes to macosx/tkMacOSXDialog.c.

1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
	modalReturnCode = cmdObj ? 0 :
	    [NSApp runModalForWindow:[alert window]];
    } else {
	modalReturnCode = [alert runModal];
	[NSApp tkAlertDidEnd:alert returnCode:modalReturnCode
		contextInfo:callbackInfo];
    }
    result = (modalReturnCode < 1) ? TCL_OK : TCL_ERROR;
 end:
    [alert release];
    return result;
}
 
/*
 * ----------------------------------------------------------------------







|







1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
	modalReturnCode = cmdObj ? 0 :
	    [NSApp runModalForWindow:[alert window]];
    } else {
	modalReturnCode = [alert runModal];
	[NSApp tkAlertDidEnd:alert returnCode:modalReturnCode
		contextInfo:callbackInfo];
    }
    result = (modalReturnCode >= NSAlertFirstButtonReturn) ? TCL_OK : TCL_ERROR;
 end:
    [alert release];
    return result;
}
 
/*
 * ----------------------------------------------------------------------

Changes to macosx/tkMacOSXDraw.c.

134
135
136
137
138
139
140

141
142
143
144
145
146
147
...
170
171
172
173
174
175
176

177
178
179
180
181
182
183
....
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
....
1631
1632
1633
1634
1635
1636
1637

1638
1639
1640
1641
1642
1643
1644
....
1761
1762
1763
1764
1765
1766
1767

1768
1769
1770
1771
1772
1773
1774
....
1784
1785
1786
1787
1788
1789
1790

1791
1792
1793
1794
1795
1796
1797
....
1800
1801
1802
1803
1804
1805
1806

1807
1808
1809
1810
1811
1812
1813
....
1825
1826
1827
1828
1829
1830
1831

1832
1833
1834
1835
1836
1837
1838
1839
....
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
....
1903
1904
1905
1906
1907
1908
1909

1910
1911
1912
1913
1914
1915
1916
1917
....
1936
1937
1938
1939
1940
1941
1942

1943
1944
1945
1946
1947
1948
1949
	unsigned int height)
{
    MacDrawable *mac_drawable = (MacDrawable *) drawable;
    CGContextRef cg_context=NULL;
    CGImageRef cg_image=NULL, sub_cg_image=NULL;
    NSBitmapImageRep *bitmap_rep=NULL;
    NSView *view=NULL;

    if ( mac_drawable->flags & TK_IS_PIXMAP ) {
	/*
	   This means that the MacDrawable is functioning as a Tk Pixmap, so its view
	   field is NULL.
	*/
	cg_context = GetCGContextForDrawable(drawable);
	CGRect image_rect = CGRectMake(x, y, width, height);
................................................................................
	} else {
	    TkMacOSXDbgMsg("Could not lock focus on view.");
	}

    } else {
	TkMacOSXDbgMsg("Invalid source drawable");
    }

    return bitmap_rep;
}
 
/*
 *----------------------------------------------------------------------
 *
 * XCopyArea --
................................................................................
	    /* Queue up Expose events for the damage region. */
	    int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
	    [view generateExposeEvents:dmgRgn childrenOnly:1];
	    Tcl_SetServiceMode(oldMode);

	    /* Belt and suspenders: make the AppKit request a redraw
	       when it gets control again. */
	    [view setNeedsDisplay:YES];
  	}
    } else {
	dmgRgn = HIShapeCreateEmpty();
	TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
    }

    if (dmgRgn) {
................................................................................
    int useCG, /* advisory only ! */
    TkMacOSXDrawingContext *dcPtr)
{
    MacDrawable *macDraw = ((MacDrawable*)d);
    int dontDraw = 0, isWin = 0;
    TkMacOSXDrawingContext dc = {};
    CGRect clipBounds;


    dc.clipRgn = TkMacOSXGetClipRgn(d);
    if (!dontDraw) {
	ClipToGC(d, gc, &dc.clipRgn);
	dontDraw = dc.clipRgn ? HIShapeIsEmpty(dc.clipRgn) : 0;
    }
    if (dontDraw) {
................................................................................
    }
end:
    if (dontDraw && dc.clipRgn) {
	CFRelease(dc.clipRgn);
	dc.clipRgn = NULL;
    }
    *dcPtr = dc;

    return !dontDraw;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXRestoreDrawingContext --
................................................................................
 *----------------------------------------------------------------------
 */

void
TkMacOSXRestoreDrawingContext(
    TkMacOSXDrawingContext *dcPtr)
{

    if (dcPtr->context) {
	CGContextSynchronize(dcPtr->context);
	[[dcPtr->view window] setViewsNeedDisplay:YES];
	[[dcPtr->view window] enableFlushWindow];
	if (dcPtr->focusLocked) {
	    [dcPtr->view unlockFocus];
	} else {
................................................................................
    }
    if (dcPtr->clipRgn) {
	CFRelease(dcPtr->clipRgn);
    }
#ifdef TK_MAC_DEBUG
    bzero(dcPtr, sizeof(TkMacOSXDrawingContext));
#endif /* TK_MAC_DEBUG */

}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXGetClipRgn --
 *
................................................................................

HIShapeRef
TkMacOSXGetClipRgn(
    Drawable drawable)		/* Drawable. */
{
    MacDrawable *macDraw = (MacDrawable *) drawable;
    HIShapeRef clipRgn = NULL;


    if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
	TkMacOSXUpdateClipRgn(macDraw->winPtr);
#ifdef TK_MAC_DEBUG_DRAWING
	TkMacOSXDbgMsg("%s", macDraw->winPtr->pathName);
	NSView *view = TkMacOSXDrawableView(macDraw);
	if ([view lockFocusIfCanDraw]) {
	    CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
................................................................................
    }

    if (macDraw->drawRgn) {
	clipRgn = HIShapeCreateCopy(macDraw->drawRgn);
    } else if (macDraw->visRgn) {
	clipRgn = HIShapeCreateCopy(macDraw->visRgn);
    }

    return clipRgn;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXSetUpClippingRgn --
................................................................................
    Display *display,
    Drawable d,
    int x, int y,
    int width, int height)
{
    MacDrawable *macDraw = (MacDrawable *) d;
    NSView *view = TkMacOSXDrawableView(macDraw);


    if (macDraw->drawRgn) {
	CFRelease(macDraw->drawRgn);
	macDraw->drawRgn = NULL;
    }

    if (width >= 0 && height >= 0) {
	CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff,
................................................................................
	}
    } else {
	if (view && (macDraw->flags & TK_FOCUSED_VIEW)) {
	    [view unlockFocus];
	    macDraw->flags &= ~TK_FOCUSED_VIEW;
	}
    }

}
 
/*
 *----------------------------------------------------------------------
 *
 * ClipToGC --
 *







>







 







>







 







<







 







>







 







>







 







>







 







>







 







>
|







 







|







 







>
|







 







>







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
....
1566
1567
1568
1569
1570
1571
1572

1573
1574
1575
1576
1577
1578
1579
....
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
....
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
....
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
....
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
....
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
....
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
....
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
....
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
	unsigned int height)
{
    MacDrawable *mac_drawable = (MacDrawable *) drawable;
    CGContextRef cg_context=NULL;
    CGImageRef cg_image=NULL, sub_cg_image=NULL;
    NSBitmapImageRep *bitmap_rep=NULL;
    NSView *view=NULL;
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    if ( mac_drawable->flags & TK_IS_PIXMAP ) {
	/*
	   This means that the MacDrawable is functioning as a Tk Pixmap, so its view
	   field is NULL.
	*/
	cg_context = GetCGContextForDrawable(drawable);
	CGRect image_rect = CGRectMake(x, y, width, height);
................................................................................
	} else {
	    TkMacOSXDbgMsg("Could not lock focus on view.");
	}

    } else {
	TkMacOSXDbgMsg("Invalid source drawable");
    }
    [pool drain];
    return bitmap_rep;
}
 
/*
 *----------------------------------------------------------------------
 *
 * XCopyArea --
................................................................................
	    /* Queue up Expose events for the damage region. */
	    int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
	    [view generateExposeEvents:dmgRgn childrenOnly:1];
	    Tcl_SetServiceMode(oldMode);

	    /* Belt and suspenders: make the AppKit request a redraw
	       when it gets control again. */

  	}
    } else {
	dmgRgn = HIShapeCreateEmpty();
	TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
    }

    if (dmgRgn) {
................................................................................
    int useCG, /* advisory only ! */
    TkMacOSXDrawingContext *dcPtr)
{
    MacDrawable *macDraw = ((MacDrawable*)d);
    int dontDraw = 0, isWin = 0;
    TkMacOSXDrawingContext dc = {};
    CGRect clipBounds;
    NSAutoreleasePool *pool = [NSAutoreleasePool new];

    dc.clipRgn = TkMacOSXGetClipRgn(d);
    if (!dontDraw) {
	ClipToGC(d, gc, &dc.clipRgn);
	dontDraw = dc.clipRgn ? HIShapeIsEmpty(dc.clipRgn) : 0;
    }
    if (dontDraw) {
................................................................................
    }
end:
    if (dontDraw && dc.clipRgn) {
	CFRelease(dc.clipRgn);
	dc.clipRgn = NULL;
    }
    *dcPtr = dc;
    [pool drain];
    return !dontDraw;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXRestoreDrawingContext --
................................................................................
 *----------------------------------------------------------------------
 */

void
TkMacOSXRestoreDrawingContext(
    TkMacOSXDrawingContext *dcPtr)
{
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    if (dcPtr->context) {
	CGContextSynchronize(dcPtr->context);
	[[dcPtr->view window] setViewsNeedDisplay:YES];
	[[dcPtr->view window] enableFlushWindow];
	if (dcPtr->focusLocked) {
	    [dcPtr->view unlockFocus];
	} else {
................................................................................
    }
    if (dcPtr->clipRgn) {
	CFRelease(dcPtr->clipRgn);
    }
#ifdef TK_MAC_DEBUG
    bzero(dcPtr, sizeof(TkMacOSXDrawingContext));
#endif /* TK_MAC_DEBUG */
    [pool drain];
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXGetClipRgn --
 *
................................................................................

HIShapeRef
TkMacOSXGetClipRgn(
    Drawable drawable)		/* Drawable. */
{
    MacDrawable *macDraw = (MacDrawable *) drawable;
    HIShapeRef clipRgn = NULL;
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    
    if (macDraw->winPtr && macDraw->flags & TK_CLIP_INVALID) {
	TkMacOSXUpdateClipRgn(macDraw->winPtr);
#ifdef TK_MAC_DEBUG_DRAWING
	TkMacOSXDbgMsg("%s", macDraw->winPtr->pathName);
	NSView *view = TkMacOSXDrawableView(macDraw);
	if ([view lockFocusIfCanDraw]) {
	    CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
................................................................................
    }

    if (macDraw->drawRgn) {
	clipRgn = HIShapeCreateCopy(macDraw->drawRgn);
    } else if (macDraw->visRgn) {
	clipRgn = HIShapeCreateCopy(macDraw->visRgn);
    }
    [pool drain];
    return clipRgn;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXSetUpClippingRgn --
................................................................................
    Display *display,
    Drawable d,
    int x, int y,
    int width, int height)
{
    MacDrawable *macDraw = (MacDrawable *) d;
    NSView *view = TkMacOSXDrawableView(macDraw);
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    
    if (macDraw->drawRgn) {
	CFRelease(macDraw->drawRgn);
	macDraw->drawRgn = NULL;
    }

    if (width >= 0 && height >= 0) {
	CGRect clipRect = CGRectMake(x + macDraw->xOff, y + macDraw->yOff,
................................................................................
	}
    } else {
	if (view && (macDraw->flags & TK_FOCUSED_VIEW)) {
	    [view unlockFocus];
	    macDraw->flags &= ~TK_FOCUSED_VIEW;
	}
    }
    [pool drain];
}
 
/*
 *----------------------------------------------------------------------
 *
 * ClipToGC --
 *

Changes to macosx/tkMacOSXInit.c.

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
...
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
	if (Tcl_MacOSXOpenVersionedBundleResources(interp,
		"com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX,
		tkLibPath) != TCL_OK) {
	    TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed");
	}
#endif

	static NSAutoreleasePool *pool = nil;
	if (!pool) {
	    pool = [NSAutoreleasePool new];
	}
	[[NSUserDefaults standardUserDefaults] registerDefaults:
		[NSDictionary dictionaryWithObjectsAndKeys:
		[NSNumber numberWithBool:YES],
		@"_NSCanWrapButtonTitles",
		[NSNumber numberWithInt:-1],
		@"NSStringDrawingTypesetterBehavior",
		nil]];
................................................................................
	}

	[NSApp _setupEventLoop];
	TkMacOSXInitAppleEvents(interp);
	TkMacOSXUseAntialiasedText(interp, -1);
	TkMacOSXInitCGDrawing(interp, TRUE, 0);
	[pool drain];
	pool = [NSAutoreleasePool new];

	/*
	 * FIXME: Close stdin & stdout for remote debugging otherwise we will
	 * fight with gdb for stdin & stdout
	 */

	if (getenv("XCNOSTDIN") != NULL) {







<
<
|
<







 







<







238
239
240
241
242
243
244


245

246
247
248
249
250
251
252
...
309
310
311
312
313
314
315

316
317
318
319
320
321
322
	if (Tcl_MacOSXOpenVersionedBundleResources(interp,
		"com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 0, PATH_MAX,
		tkLibPath) != TCL_OK) {
	    TkMacOSXDbgMsg("Tcl_MacOSXOpenVersionedBundleResources failed");
	}
#endif



	NSAutoreleasePool *pool = [NSAutoreleasePool new];

	[[NSUserDefaults standardUserDefaults] registerDefaults:
		[NSDictionary dictionaryWithObjectsAndKeys:
		[NSNumber numberWithBool:YES],
		@"_NSCanWrapButtonTitles",
		[NSNumber numberWithInt:-1],
		@"NSStringDrawingTypesetterBehavior",
		nil]];
................................................................................
	}

	[NSApp _setupEventLoop];
	TkMacOSXInitAppleEvents(interp);
	TkMacOSXUseAntialiasedText(interp, -1);
	TkMacOSXInitCGDrawing(interp, TRUE, 0);
	[pool drain];


	/*
	 * FIXME: Close stdin & stdout for remote debugging otherwise we will
	 * fight with gdb for stdin & stdout
	 */

	if (getenv("XCNOSTDIN") != NULL) {

Changes to macosx/tkMacOSXNotify.c.

211
212
213
214
215
216
217

218
219
220
221
222
223
224
225

226
227
228
229
230
231
232
TkMacOSXEventsSetupProc(
    ClientData clientData,
    int flags)
{
    if (flags & TCL_WINDOW_EVENTS &&
	![[NSRunLoop currentRunLoop] currentMode]) {
	static Tcl_Time zeroBlockTime = { 0, 0 };

 	/* Call this with dequeue=NO -- just checking if the queue is empty. */ 
	NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask
 						   untilDate:[NSDate distantPast]
 						      inMode:GetRunLoopMode(TkMacOSXGetModalSession())
 						     dequeue:NO];
	if (currentEvent && currentEvent.type > 0) {
	    Tcl_SetMaxBlockTime(&zeroBlockTime);
	}

    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXEventsCheckProc --







>








>







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
TkMacOSXEventsSetupProc(
    ClientData clientData,
    int flags)
{
    if (flags & TCL_WINDOW_EVENTS &&
	![[NSRunLoop currentRunLoop] currentMode]) {
	static Tcl_Time zeroBlockTime = { 0, 0 };
	NSAutoreleasePool *pool = [NSAutoreleasePool new];
 	/* Call this with dequeue=NO -- just checking if the queue is empty. */ 
	NSEvent *currentEvent = [NSApp nextEventMatchingMask:NSAnyEventMask
 						   untilDate:[NSDate distantPast]
 						      inMode:GetRunLoopMode(TkMacOSXGetModalSession())
 						     dequeue:NO];
	if (currentEvent && currentEvent.type > 0) {
	    Tcl_SetMaxBlockTime(&zeroBlockTime);
	}
	[pool drain];
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXEventsCheckProc --

Changes to macosx/tkMacOSXSubwindows.c.

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
329
330
331
332
333
334
335

336
337
338
339
340
341
342
XResizeWindow(
    Display *display,		/* Display. */
    Window window,		/* Window. */
    unsigned int width,
    unsigned int height)
{
    MacDrawable *macWin = (MacDrawable *) window;

    display->request++;
    if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
	NSWindow *w = macWin->winPtr->wmInfoPtr->window;

	if (w) {
	    NSRect r = [w contentRectForFrameRect:[w frame]];
	    r.origin.y += r.size.height - height;
................................................................................
	    r.size.width = width;
	    r.size.height = height;
	    [w setFrame:[w frameRectForContentRect:r] display:YES];
	}
    } else {
	MoveResizeWindow(macWin);
    }

}
 
/*
 *----------------------------------------------------------------------
 *
 * XMoveResizeWindow --
 *







|







 







>







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
XResizeWindow(
    Display *display,		/* Display. */
    Window window,		/* Window. */
    unsigned int width,
    unsigned int height)
{
    MacDrawable *macWin = (MacDrawable *) window;
    NSAutoreleasePool *pool= [NSAutoreleasePool new];
    display->request++;
    if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
	NSWindow *w = macWin->winPtr->wmInfoPtr->window;

	if (w) {
	    NSRect r = [w contentRectForFrameRect:[w frame]];
	    r.origin.y += r.size.height - height;
................................................................................
	    r.size.width = width;
	    r.size.height = height;
	    [w setFrame:[w frameRectForContentRect:r] display:YES];
	}
    } else {
	MoveResizeWindow(macWin);
    }
    [pool drain];
}
 
/*
 *----------------------------------------------------------------------
 *
 * XMoveResizeWindow --
 *

Changes to macosx/tkMacOSXWm.c.

386
387
388
389
390
391
392

393
394
395
396
397
398
399
400
401

402
403
404

405
406


407

408
409


















410
411

412
413
414
415
416
417
418
...
843
844
845
846
847
848
849









850
851
852
853
854
855
856
....
5443
5444
5445
5446
5447
5448
5449


5450
5451
5452
5453
5454
5455
5456
....
5526
5527
5528
5529
5530
5531
5532


5533
5534
5535
5536
5537
5538
5539
}
@end

@implementation TKWindow
@end

@implementation TKWindow(TKWm)

- (BOOL) canBecomeKeyWindow
{
    TkWindow *winPtr = TkMacOSXGetTkWindow(self);

    return (winPtr && winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass ==
	    kHelpWindowClass || winPtr->wmInfoPtr->attributes &
	    kWindowNoActivatesAttribute)) ? NO : YES;
}


- (id) retain
{
#if DEBUG_ZOMBIES

    const char *title = [[self title] UTF8String];
    if (title != NULL) {


	printf("Retaining %s with count %lu\n", title, [self retainCount]);

    }
#endif


















    return [super retain];
}

@end

#pragma mark -
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
	    [parent removeChildWindow:window];
	}
	[window close];
	TkMacOSXUnregisterMacWindow(window);
        if (winPtr->window) {
            ((MacDrawable *) winPtr->window)->view = nil;
        }









        [window release];
	wmPtr->window = NULL;
       /* Activate the highest window left on the screen. */
       NSArray *windows = [NSApp orderedWindows];
       if ( [windows count] > 0 ) {
	   NSWindow *front = [windows objectAtIndex:0];
	   if ( front && [front canBecomeKeyWindow] ) {
................................................................................
	return;

	/*
	 * TODO: Here we should handle out of process embedding.
	 */
    }



    WindowClass macClass = wmPtr->macClass;
    wmPtr->attributes &= (tkAlwaysValidAttributes |
	    macClassAttrs[macClass].validAttrs);
    wmPtr->flags |= macClassAttrs[macClass].flags |
	    ((wmPtr->attributes & kWindowResizableAttribute) ? 0 :
	    WM_WIDTH_NOT_RESIZABLE|WM_HEIGHT_NOT_RESIZABLE);
    UInt64 attributes = (wmPtr->attributes &
................................................................................
    geometry.size.height += structureRect.size.height;
    geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y +
	    geometry.size.height);
    [window setFrame:geometry display:NO];

    TkMacOSXRegisterOffScreenWindow((Window) macWin, window);
    macWin->flags |= TK_HOST_EXISTS;


}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXRegisterOffScreenWindow --
 *







>









>


<
>

|
>
>
|
>
|
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>







 







>
>
>
>
>
>
>
>
>







 







>
>







 







>
>







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405

406
407
408
409
410
411
412
413

414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
...
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
....
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
....
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
}
@end

@implementation TKWindow
@end

@implementation TKWindow(TKWm)

- (BOOL) canBecomeKeyWindow
{
    TkWindow *winPtr = TkMacOSXGetTkWindow(self);

    return (winPtr && winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass ==
	    kHelpWindowClass || winPtr->wmInfoPtr->attributes &
	    kWindowNoActivatesAttribute)) ? NO : YES;
}

#if DEBUG_ZOMBIES
- (id) retain
{

    id result = [super retain];
    const char *title = [[self title] UTF8String];
    if (title == nil) {
	title = "unnamed window";
    }
    printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]);
    return result;
}


- (id) autorelease
{
    id result = [super autorelease];
    const char *title = [[self title] UTF8String];
    if (title == nil) {
	title = "unnamed window";
    }
    printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]);
    return result;
}

- (oneway void) release {
    const char *title = [[self title] UTF8String];
    if (title == nil) {
	title = "unnamed window";
    }
    printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]);
    [super release];
}
#endif
@end

#pragma mark -
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
	    [parent removeChildWindow:window];
	}
	[window close];
	TkMacOSXUnregisterMacWindow(window);
        if (winPtr->window) {
            ((MacDrawable *) winPtr->window)->view = nil;
        }
#if DEBUG_ZOMBIES
	{
	    const char *title = [[window title] UTF8String];
	    if (title == nil) {
		title = "unnamed window";
	    }
	    printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]);
	}
#endif
        [window release];
	wmPtr->window = NULL;
       /* Activate the highest window left on the screen. */
       NSArray *windows = [NSApp orderedWindows];
       if ( [windows count] > 0 ) {
	   NSWindow *front = [windows objectAtIndex:0];
	   if ( front && [front canBecomeKeyWindow] ) {
................................................................................
	return;

	/*
	 * TODO: Here we should handle out of process embedding.
	 */
    }

    NSAutoreleasePool *pool = [NSAutoreleasePool new];

    WindowClass macClass = wmPtr->macClass;
    wmPtr->attributes &= (tkAlwaysValidAttributes |
	    macClassAttrs[macClass].validAttrs);
    wmPtr->flags |= macClassAttrs[macClass].flags |
	    ((wmPtr->attributes & kWindowResizableAttribute) ? 0 :
	    WM_WIDTH_NOT_RESIZABLE|WM_HEIGHT_NOT_RESIZABLE);
    UInt64 attributes = (wmPtr->attributes &
................................................................................
    geometry.size.height += structureRect.size.height;
    geometry.origin.y = tkMacOSXZeroScreenHeight - (geometry.origin.y +
	    geometry.size.height);
    [window setFrame:geometry display:NO];

    TkMacOSXRegisterOffScreenWindow((Window) macWin, window);
    macWin->flags |= TK_HOST_EXISTS;

    [pool drain];
}
 
/*
 *----------------------------------------------------------------------
 *
 * TkMacOSXRegisterOffScreenWindow --
 *

Changes to macosx/tkMacOSXXStubs.c.

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


154
155
156
157
158
159
160
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
    Display *display;
    Screen *screen;
    int fd = 0;
    static NSRect maxBounds = {{0, 0}, {0, 0}};
    static char vendor[25] = "";
    NSArray *cgVers;
    NSAutoreleasePool *pool;

    if (gMacDisplay != NULL) {
	if (strcmp(gMacDisplay->display->display_name, display_name) == 0) {
	    return gMacDisplay;
	} else {
	    return NULL;
	}
    }



    display = (Display *) ckalloc(sizeof(Display));
    screen  = (Screen *) ckalloc(sizeof(Screen));
    bzero(display, sizeof(Display));
    bzero(screen, sizeof(Screen));

    display->resource_alloc = MacXIdAlloc;
................................................................................
    display->qlen	    = 0;
    display->fd		    = fd;
    display->screens	    = screen;
    display->nscreens	    = 1;
    display->default_screen = 0;
    display->display_name   = (char *) macScreenName;

    pool = [NSAutoreleasePool new];
    cgVers = [[[NSBundle bundleWithIdentifier:@"com.apple.CoreGraphics"]
	    objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
	    componentsSeparatedByString:@"."];
    if ([cgVers count] >= 2) {
	display->proto_major_version = [[cgVers objectAtIndex:1] integerValue];
    }
    if ([cgVers count] >= 3) {
................................................................................
	snprintf(vendor, sizeof(vendor), "Apple AppKit %g",
		NSAppKitVersionNumber);
    }
    display->vendor = vendor;
    {
	int major, minor, patch;

#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
	Gestalt(gestaltSystemVersionMajor, (SInt32*)&major);
	Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor);
	Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch);
#else
	NSOperatingSystemVersion systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
	major = systemVersion.majorVersion;
	minor = systemVersion.minorVersion;







<








>
>







 







<







 







|







138
139
140
141
142
143
144

145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
...
163
164
165
166
167
168
169

170
171
172
173
174
175
176
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
    Display *display;
    Screen *screen;
    int fd = 0;
    static NSRect maxBounds = {{0, 0}, {0, 0}};
    static char vendor[25] = "";
    NSArray *cgVers;


    if (gMacDisplay != NULL) {
	if (strcmp(gMacDisplay->display->display_name, display_name) == 0) {
	    return gMacDisplay;
	} else {
	    return NULL;
	}
    }

    NSAutoreleasePool *pool = [NSAutoreleasePool new];

    display = (Display *) ckalloc(sizeof(Display));
    screen  = (Screen *) ckalloc(sizeof(Screen));
    bzero(display, sizeof(Display));
    bzero(screen, sizeof(Screen));

    display->resource_alloc = MacXIdAlloc;
................................................................................
    display->qlen	    = 0;
    display->fd		    = fd;
    display->screens	    = screen;
    display->nscreens	    = 1;
    display->default_screen = 0;
    display->display_name   = (char *) macScreenName;


    cgVers = [[[NSBundle bundleWithIdentifier:@"com.apple.CoreGraphics"]
	    objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
	    componentsSeparatedByString:@"."];
    if ([cgVers count] >= 2) {
	display->proto_major_version = [[cgVers objectAtIndex:1] integerValue];
    }
    if ([cgVers count] >= 3) {
................................................................................
	snprintf(vendor, sizeof(vendor), "Apple AppKit %g",
		NSAppKitVersionNumber);
    }
    display->vendor = vendor;
    {
	int major, minor, patch;

#if MAC_OS_X_VERSION_MIN_REQUIRED < 10100
	Gestalt(gestaltSystemVersionMajor, (SInt32*)&major);
	Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor);
	Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch);
#else
	NSOperatingSystemVersion systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
	major = systemVersion.majorVersion;
	minor = systemVersion.minorVersion;

Changes to tests/bevel.tcl.

38
39
40
41
42
43
44

45
46
47
48
49
50
51
...
121
122
123
124
125
126
127







128






129






130
131





132
133

134
135
136
137
138
139
regions to exercise the bevel-drawing facilities of
DisplayLineBackground.  The letters have the following
significance:

r - should appear raised
u - should appear raised and also slightly offset vertically
s - should appear sunken

n - preceding relief should extend right to end of line.
* - should appear "normal"
x - extra long lines to allow horizontal scrolling.

Try scrolling the text both vertically and horizontally to
be sure that the bevels are still drawn correctly.

................................................................................
    .t.t insert end rrrrr r1
}
.t.t insert end \n
.t.t insert end rrr r1
.t.t insert end *****
.t.t insert end rrr r1













































>







 







>
>
>
>
>
>
>

>
>
>
>
>
>

>
>
>
>
>
>
|

>
>
>
>
>
|

>

<
<
<
<
<
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
...
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





regions to exercise the bevel-drawing facilities of
DisplayLineBackground.  The letters have the following
significance:

r - should appear raised
u - should appear raised and also slightly offset vertically
s - should appear sunken
S - should appear solid
n - preceding relief should extend right to end of line.
* - should appear "normal"
x - extra long lines to allow horizontal scrolling.

Try scrolling the text both vertically and horizontally to
be sure that the bevels are still drawn correctly.

................................................................................
    .t.t insert end rrrrr r1
}
.t.t insert end \n
.t.t insert end rrr r1
.t.t insert end *****
.t.t insert end rrr r1

font configure TkFixedFont -size 20
.t.t tag configure sol100 -relief solid -borderwidth 100 \
                          -foreground red -font TkFixedFont
.t.t tag configure sol12 -relief solid -borderwidth 12 \
                          -foreground red -font TkFixedFont
.t.t tag configure big -font TkFixedFont
set ind [.t.t index end]

.t.t insert end "\n\nBorders do not leak on the neighbour chars"
.t.t insert end "\nOnly \"S\" is on dark background"
.t.t insert end {
 xxx
 x} {} S sol100 {x
 xxx}

.t.t insert end "\n\nA very thick border grows toward the inside of the tagged area only"
.t.t insert end "\nOnly \"S\" is on dark background"
.t.t insert end {
 xxxx} {} SSSSS sol100 {xxxx
 x} {} SSSSSSSSSSSSSSSSSS sol100 {x
 xxx} {} SSSSSSSSS sol100 xxxx {}
}

.t.t insert end "\n\nA thinner border is continuous"
.t.t insert end {
 xxxx} {} SSSSS sol12 {xxxx
 x} {} SSSSSSSSSSSSSSSSSS sol12 {x
 xxx} {} SSSSSSSSS sol12 xxxx {}
}

.t.t tag add big $ind end






Changes to win/configure.

3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
		    ;;
		ia64)
		    MACHINE="IA64"
		    PATH64="${MSSDK}/Bin/Win64"
		    ;;
	    esac
	    if test ! -d "${PATH64}" ; then
		{ echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
		{ echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5
echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
		do64bit="no"
	    else
		echo "$as_me:$LINENO: result:    Using 64-bit $MACHINE mode" >&5
echo "${ECHO_T}   Using 64-bit $MACHINE mode" >&6
	    fi
	fi

	LIBS="user32.lib advapi32.lib ws2_32.lib"

	case "x`echo \${VisualStudioVersion}`" in
		x1[4-9]*)
		    LIBS="$LIBS ucrt.lib"







|
|
|
<
<
<
|

<







3855
3856
3857
3858
3859
3860
3861
3862
3863
3864



3865
3866

3867
3868
3869
3870
3871
3872
3873
		    ;;
		ia64)
		    MACHINE="IA64"
		    PATH64="${MSSDK}/Bin/Win64"
		    ;;
	    esac
	    if test ! -d "${PATH64}" ; then
		{ echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5
echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;}
	    fi



	    echo "$as_me:$LINENO: result:    Using 64-bit $MACHINE mode" >&5
echo "${ECHO_T}   Using 64-bit $MACHINE mode" >&6

	fi

	LIBS="user32.lib advapi32.lib ws2_32.lib"

	case "x`echo \${VisualStudioVersion}`" in
		x1[4-9]*)
		    LIBS="$LIBS ucrt.lib"

Changes to win/tcl.m4.

811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
		    ;;
		ia64)
		    MACHINE="IA64"
		    PATH64="${MSSDK}/Bin/Win64"
		    ;;
	    esac
	    if test ! -d "${PATH64}" ; then
		AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
		AC_MSG_WARN([Ensure latest Platform SDK is installed])
		do64bit="no"
	    else
		AC_MSG_RESULT([   Using 64-bit $MACHINE mode])
	    fi
	fi

	LIBS="user32.lib advapi32.lib ws2_32.lib"

	case "x`echo \${VisualStudioVersion}`" in
		x1[[4-9]]*)
		    LIBS="$LIBS ucrt.lib"







|
|
<
<
|
<







811
812
813
814
815
816
817
818
819


820

821
822
823
824
825
826
827
		    ;;
		ia64)
		    MACHINE="IA64"
		    PATH64="${MSSDK}/Bin/Win64"
		    ;;
	    esac
	    if test ! -d "${PATH64}" ; then
		AC_MSG_WARN([Could not find 64-bit $MACHINE SDK])
	    fi


	    AC_MSG_RESULT([   Using 64-bit $MACHINE mode])

	fi

	LIBS="user32.lib advapi32.lib ws2_32.lib"

	case "x`echo \${VisualStudioVersion}`" in
		x1[[4-9]]*)
		    LIBS="$LIBS ucrt.lib"